From 4282fa8828d77afacf7ee1f606b65bc74ce7d104 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Tue, 16 Jan 2024 18:19:35 +0800 Subject: [PATCH] minor patch on application adapter --- addon/adapters/application.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addon/adapters/application.js b/addon/adapters/application.js index 80cc93f..352ddf1 100644 --- a/addon/adapters/application.js +++ b/addon/adapters/application.js @@ -95,7 +95,9 @@ export default class ApplicationAdapter extends RESTAdapter { const localStorageSession = JSON.parse(window.localStorage.getItem('ember_simple_auth-session')); if (localStorageSession) { const { authenticated } = localStorageSession; - token = authenticated.token; + if (authenticated) { + token = authenticated.token; + } // Check isAuthenticated again isAuthenticated = !!token;