-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refine docs and error messages (#27)
* docs: refine docs for all functions * feat: export type for SgidClient init params * docs: document default for scope param * feat: improve error messages and extract into file * test: update test error messages
- Loading branch information
1 parent
1111f49
commit c7dcf95
Showing
3 changed files
with
72 additions
and
28 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,15 @@ | ||
// authorization URL error, also used in callback | ||
export const MISSING_REDIRECT_URI_ERROR = | ||
'No redirect URI registered with this client. You must either specify a valid redirect URI in the SgidClient constructor, or pass it to the authorizationUrl and callback functions.' | ||
|
||
// callback errors | ||
export const NO_SUB_ERROR = 'Authorization server did not return the sub claim' | ||
export const NO_ACCESS_TOKEN_ERROR = | ||
'Authorization server did not return an access token' | ||
|
||
// userinfo errors | ||
export const PRIVATE_KEY_IMPORT_ERROR = | ||
'Failed to import private key. Check that privateKey is a valid PKCS1 or PKCS8 key.' | ||
export const DECRYPT_BLOCK_KEY_ERROR = | ||
'Unable to decrypt or import payload key. Check that you used the correct private key.' | ||
export const DECRYPT_PAYLOAD_ERROR = 'Unable to decrypt payload' |
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