From 9535a96437e2cb4292cb0523858d4d994a821e9a Mon Sep 17 00:00:00 2001 From: DaviMarinho Date: Thu, 16 Nov 2023 11:42:54 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20nome=20correto=20a=20fun=C3=A7=C3=A3?= =?UTF-8?q?o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: DaviMarinho --- src/app/app-routing.module.ts | 12 ++++++------ ...-token.guard.spec.ts => with-token.guard.spec.ts} | 8 ++++---- .../guard/{no-token.guard.ts => with-token.guard.ts} | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) rename src/app/guard/{no-token.guard.spec.ts => with-token.guard.spec.ts} (54%) rename src/app/guard/{no-token.guard.ts => with-token.guard.ts} (89%) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9875699a..b73eb2f2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -14,14 +14,14 @@ import { AuthGuard } from './guard/auth.guard'; import { EditUserComponent } from './pages/edit-user/edit-user.component'; import { SuggestAgendaComponent } from './pages/suggest-agenda/suggest-agenda.component'; import { ParticipateComponent } from './pages/participate/participate.component'; -import { NoTokenGuard } from './guard/no-token.guard'; +import { WithTokenGuard } from './guard/with-token.guard'; const routes: Routes = [ - { path: 'login', component: LoginComponent, canActivate: [NoTokenGuard], }, - { path: 'register', component: RegisterComponent, canActivate: [NoTokenGuard], }, - { path: 'loginsocial', component: LoginSocialComponent, canActivate: [NoTokenGuard], }, - { path: 'sendCodeResetPassword', component: CheckCodeRestPasswordComponent, canActivate: [NoTokenGuard], }, - { path: 'changePassword', component: ResetPasswordComponent, canActivate: [NoTokenGuard], }, + { path: 'login', component: LoginComponent, canActivate: [WithTokenGuard], }, + { path: 'register', component: RegisterComponent, canActivate: [WithTokenGuard], }, + { path: 'loginsocial', component: LoginSocialComponent, canActivate: [WithTokenGuard], }, + { path: 'sendCodeResetPassword', component: CheckCodeRestPasswordComponent, canActivate: [WithTokenGuard], }, + { path: 'changePassword', component: ResetPasswordComponent, canActivate: [WithTokenGuard], }, { path: 'videos', component: VideoComponent }, { path: 'video/:idVideo', component: VideoViewerComponent }, { path: 'activeAccount', component: ActiveAccountComponent }, diff --git a/src/app/guard/no-token.guard.spec.ts b/src/app/guard/with-token.guard.spec.ts similarity index 54% rename from src/app/guard/no-token.guard.spec.ts rename to src/app/guard/with-token.guard.spec.ts index da48db84..15c88049 100644 --- a/src/app/guard/no-token.guard.spec.ts +++ b/src/app/guard/with-token.guard.spec.ts @@ -1,13 +1,13 @@ import { TestBed } from '@angular/core/testing'; -import { NoTokenGuard } from './no-token.guard'; +import { WithTokenGuard } from './with-token.guard'; -describe('NoTokenGuard', () => { - let guard: NoTokenGuard; +describe('WithTokenGuard', () => { + let guard: WithTokenGuard; beforeEach(() => { TestBed.configureTestingModule({}); - guard = TestBed.inject(NoTokenGuard); + guard = TestBed.inject(WithTokenGuard); }); it('should be created', () => { diff --git a/src/app/guard/no-token.guard.ts b/src/app/guard/with-token.guard.ts similarity index 89% rename from src/app/guard/no-token.guard.ts rename to src/app/guard/with-token.guard.ts index 1b229db5..b296b0d9 100644 --- a/src/app/guard/no-token.guard.ts +++ b/src/app/guard/with-token.guard.ts @@ -5,7 +5,7 @@ import { AuthService } from '../services/auth.service'; @Injectable({ providedIn: 'root' }) -export class NoTokenGuard implements CanActivate { +export class WithTokenGuard implements CanActivate { constructor(private authService: AuthService, private router: Router) {} canActivate(): boolean {