marvin-auth-kit
Advanced tools
Comparing version 5.2.4 to 5.2.5
@@ -69,3 +69,3 @@ import axios from "axios"; | ||
// remove ready only && toSerialize props | ||
const { auth_keypair_public, version, metadata_configuration, ...requestBody } = config; | ||
const { auth_keypair_public, metadata_configuration, version, ...requestBody } = config; | ||
try { | ||
@@ -83,3 +83,3 @@ const url = `${fullUrl(_config)}/config`; | ||
}); | ||
return { ..._cachedServerconfig, metadata_configuration }; | ||
return _cachedServerconfig; | ||
} | ||
@@ -86,0 +86,0 @@ else { |
@@ -1,1 +0,1 @@ | ||
export declare function useCurrentUser<T>(): T; | ||
export declare function useCurrentUser<T>(): T | undefined; |
@@ -17,3 +17,5 @@ import { useEffect, useState } from "react"; | ||
}, [tokens.token]); | ||
if (!tokens.token && tokens.refreshToken) | ||
return [true, false]; | ||
return [hookState.loading, hookState.authenticated]; | ||
}; |
{ | ||
"name": "marvin-auth-kit", | ||
"version": "5.2.4", | ||
"version": "5.2.5", | ||
"description": "Javscript authentication kit", | ||
@@ -48,3 +48,3 @@ "main": "dist/index.js", | ||
"mailslurp-client": "^8.7.8", | ||
"react": "^16.13.1", | ||
"react": "^17.0.2", | ||
"ts-jest": "^26.3.0", | ||
@@ -51,0 +51,0 @@ "typescript": "^4.5.4" |
@@ -74,3 +74,8 @@ import axios from "axios"; | ||
// remove ready only && toSerialize props | ||
const { auth_keypair_public, version, metadata_configuration, ...requestBody } = config; | ||
const { | ||
auth_keypair_public, | ||
metadata_configuration, | ||
version, | ||
...requestBody | ||
} = config; | ||
try { | ||
@@ -88,4 +93,3 @@ const url = `${fullUrl(_config)}/config`; | ||
}); | ||
return {..._cachedServerconfig, metadata_configuration}; | ||
return _cachedServerconfig; | ||
} else { | ||
@@ -92,0 +96,0 @@ throw response.data; |
import { tokens } from "../tokens"; | ||
export function useCurrentUser<T>(): T { | ||
export function useCurrentUser<T>(): T | undefined { | ||
const { token, initialisationToken } = tokens.get(); | ||
@@ -5,0 +5,0 @@ |
@@ -20,3 +20,4 @@ import { useEffect, useState } from "react"; | ||
if (!tokens.token && tokens.refreshToken) return [true, false]; | ||
return [hookState.loading, hookState.authenticated]; | ||
}; |
151447
4144