-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adiciona mensagens personalizadas * Se o usuário não tiver ativado a conta e tentar fazer login, redirecionar para a tela de ativar a conta e mostrar o erro Signed-off-by: DaviMarinho <[email protected]> * Corrige redirecionamento para editar usuário Signed-off-by: DaviMarinho <[email protected]> * Os inputs vem com as informações do usuário Signed-off-by: DaviMarinho <[email protected]> * Adiciona primeng e o tema da aplicação Signed-off-by: DaviMarinho <[email protected]> * Quando o usuário estiver logado não consegue acessar login e registro Signed-off-by: DaviMarinho <[email protected]> * Adiciona e melhora mensagens de erro, e cria o logout Signed-off-by: DaviMarinho <[email protected]> * Melhora mensagens de erro Signed-off-by: DaviMarinho <[email protected]> * Adiciona botão para ativar conta no login Signed-off-by: DaviMarinho <[email protected]> * Organiza pastas Signed-off-by: DaviMarinho <[email protected]> * Atualiza gitignore Signed-off-by: DaviMarinho <[email protected]> * Adiciona testes unitários no login Signed-off-by: DaviMarinho <[email protected]> * Adiciona nome correto a função Signed-off-by: DaviMarinho <[email protected]> * Corrige deleção de usuário Signed-off-by: DaviMarinho <[email protected]> * Corrigindo detalhes Signed-off-by: DaviMarinho <[email protected]> --------- Signed-off-by: DaviMarinho <[email protected]>
- Loading branch information
1 parent
de09b83
commit 35ec49b
Showing
30 changed files
with
293 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { WithTokenGuard } from './with-token.guard'; | ||
|
||
describe('WithTokenGuard', () => { | ||
let guard: WithTokenGuard; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
guard = TestBed.inject(WithTokenGuard); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(guard).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { CanActivate, Router } from '@angular/router'; | ||
import { AuthService } from '../services/auth.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class WithTokenGuard implements CanActivate { | ||
constructor(private authService: AuthService, private router: Router) {} | ||
|
||
canActivate(): boolean { | ||
if (!this.authService.isAuthenticated()) { | ||
return true; | ||
} else { | ||
this.router.navigate(['/videos']); | ||
return false; | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...es/user-token-interceptor.service.spec.ts → ...or/user-token-interceptor.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.