mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-16 20:59:26 +00:00
add auth docs, add eslint import/order
This commit is contained in:
@@ -6,6 +6,7 @@ export class BaseAuthGuard implements CanActivate {
|
||||
canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {
|
||||
const request = context.switchToHttp().getRequest()
|
||||
const exceptedAuthInput = 'Basic YWRtaW46cXdlcnR5'
|
||||
|
||||
if (!request.headers || !request.headers.authorization) {
|
||||
throw new UnauthorizedException([{ message: 'No any auth headers' }])
|
||||
} else {
|
||||
@@ -17,6 +18,7 @@ export class BaseAuthGuard implements CanActivate {
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user