-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): handle missing token errors by resetting to unauthenticat…
…ed state (#2518)
- Loading branch information
Showing
7 changed files
with
57 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './unauthenticated-error-codes'; |
15 changes: 15 additions & 0 deletions
15
libs/auth/driver/src/constants/unauthenticated-error-codes.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { DaffAuthErrorCodes } from '@daffodil/auth'; | ||
|
||
import { DaffAuthDriverErrorCodes } from '../errors/public_api'; | ||
|
||
/** | ||
* The error codes that indicate that the user definitely should not be in an unauthenticated state | ||
* and if an auth token exists in storage, it is invalid. | ||
* These are contrasted to network failures and other sporadic and generic errors that aren't | ||
* a guarantee of the token's invalidity. | ||
*/ | ||
export const DAFF_AUTH_UNAUTHENTICATED_ERROR_CODES = { | ||
[DaffAuthDriverErrorCodes.UNAUTHORIZED]: true, | ||
[DaffAuthDriverErrorCodes.AUTHENTICATION_FAILED]: true, | ||
[DaffAuthErrorCodes.MISSING_TOKEN]: true, | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './interfaces/public_api'; | ||
export * from './errors/public_api'; | ||
export * from './services/public_api'; | ||
export * from './constants/public_api'; |
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