diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5bcefb1a..9352c56e 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -10,6 +10,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { OAuthModule, OAuthStorage } from 'angular-oauth2-oidc'; import { InputTextModule } from 'primeng/inputtext'; import { DropdownModule } from 'primeng/dropdown'; +import { ButtonModule } from 'primeng/button'; // Declaration import { NgModule } from '@angular/core'; @@ -45,7 +46,8 @@ import { MessageService } from 'primeng/api'; BrowserAnimationsModule, OAuthModule.forRoot(), InputTextModule, - DropdownModule + DropdownModule, + ButtonModule, ], declarations: [ AppComponent, @@ -76,7 +78,7 @@ import { MessageService } from 'primeng/api'; }, { provide: OAuthStorage, useValue: localStorage }, MessageService, - ConfirmationService, + ConfirmationService ], bootstrap: [AppComponent], }) diff --git a/src/app/pages/active-account/active-account.component.ts b/src/app/pages/active-account/active-account.component.ts index a1890800..c8a51522 100644 --- a/src/app/pages/active-account/active-account.component.ts +++ b/src/app/pages/active-account/active-account.component.ts @@ -30,15 +30,17 @@ export class ActiveAccountComponent implements OnInit { if (this.userForm.valid) { this.authService.activeAccount(this.userForm.value).subscribe({ next: (data) => { - console.log(data); if (data.status === "error") { this.alertService.showMessage("error", "Erro", data.message); this.navigator("/login"); + } else { + this.alertService.showMessage("success", "Sucesso", "Email ativado com sucesso!"); + this.navigator("/login"); } - this.navigator("/login"); }, error: (error) => { - console.error(error); + console.log(error); + this.alertService.showMessage("error", "Erro", "Seu email ou senha estão inválidos, preencha os campos corretamente."); }, }); } else { @@ -48,12 +50,14 @@ export class ActiveAccountComponent implements OnInit { resendCode() { if (this.userForm.value.email) { + console.log(this.userForm.value.email); this.authService.resendCode(this.userForm.value.email).subscribe({ next: (data) => { - console.log(data); + this.alertService.showMessage("success", "Sucesso", "Email reenviado com sucesso!"); }, error: (error) => { - console.error(error); + console.log(error); + this.alertService.showMessage("error", "Erro", error.error.detail); }, }); } else { diff --git a/src/app/pages/check-code-rest-password/check-code-rest-password.component.html b/src/app/pages/check-code-rest-password/check-code-rest-password.component.html index 70e9d9b4..80d92427 100644 --- a/src/app/pages/check-code-rest-password/check-code-rest-password.component.html +++ b/src/app/pages/check-code-rest-password/check-code-rest-password.component.html @@ -2,6 +2,7 @@