File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -376,7 +376,7 @@ export function AuthProvider({
376
376
/**
377
377
* Custom hook to access authentication context.
378
378
*
379
- * @returns { Object } An object containing:
379
+ * @returns An object containing:
380
380
* - isAuthenticated: boolean indicating if the user is authenticated
381
381
* - values: object containing all values from the token
382
382
* - loading: boolean indicating if the authentication state is being loaded
@@ -404,12 +404,8 @@ export function useAuth() {
404
404
405
405
export const decodeToken = ( token : string ) : TokenPayload | undefined => {
406
406
const decodedToken = decodeJwt ( token ) ;
407
- if (
408
- ! decodedToken ||
409
- ! decodedToken . payload ||
410
- typeof decodedToken . payload === "string"
411
- ) {
407
+ if ( ! decodedToken ) {
412
408
return undefined ;
413
409
}
414
- return decodedToken . payload as TokenPayload ;
410
+ return decodedToken as TokenPayload ;
415
411
} ;
You can’t perform that action at this time.
0 commit comments