Skip to content

Commit

Permalink
Update error code for token expiry (#76)
Browse files Browse the repository at this point in the history
* wip

* wip
  • Loading branch information
hwhmeikle authored Oct 3, 2024
1 parent 798baee commit ad890f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@authsignal/browser",
"version": "0.6.1",
"version": "0.6.2",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type HandleTokenExpiredParams<T> = {
};

export function handleTokenExpired<T extends object>({response, onTokenExpired}: HandleTokenExpiredParams<T>) {
if ("error" in response && response.errorCode === "token_expired" && onTokenExpired) {
if ("error" in response && response.errorCode === "expired_token" && onTokenExpired) {
onTokenExpired();
}
}
2 changes: 1 addition & 1 deletion src/api/types/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type VerifyResponse = {
export type ErrorResponse = {
error: string;
// eslint-disable-next-line @typescript-eslint/ban-types -- This is a valid use case for an empty object
errorCode?: "token_expired" | (string & {});
errorCode?: "expired_token" | (string & {});
errorDescription?: string;
};

Expand Down

0 comments on commit ad890f8

Please sign in to comment.