Skip to content

Commit

Permalink
fix(clerk-expo): Add guard clause for tokenCache methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian McPhail committed Mar 3, 2022
1 parent 339b808 commit 4c0bd54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/expo/src/singleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function buildClerk({
frontendApi,
tokenCache,
}: BuildClerkOptions): ClerkProp {
const getToken = tokenCache ? tokenCache.getToken : getTokenFromMemory;
const saveToken = tokenCache ? tokenCache.saveToken : saveTokenInMemory;
const getToken = (tokenCache && tokenCache.getToken) ?? getTokenFromMemory;
const saveToken = (tokenCache && tokenCache.saveToken) ?? saveTokenInMemory;

if (!clerk) {
clerk = new Clerk(frontendApi);
Expand Down

0 comments on commit 4c0bd54

Please sign in to comment.