@sowell/quasar-app-extension-auth 0.3.18 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/composables/auth.ts +7 -8
package/package.json
CHANGED
package/src/composables/auth.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ionEyeSharp,
|
|
10
10
|
ionEyeOffSharp,
|
|
11
11
|
} from "@quasar/extras/ionicons-v5";
|
|
12
|
-
import {
|
|
12
|
+
import { Platform } from "quasar";
|
|
13
13
|
|
|
14
14
|
import { $prompts, $router, useAuthState } from "../injects";
|
|
15
15
|
|
|
@@ -21,7 +21,6 @@ interface HeadersInterface {
|
|
|
21
21
|
|
|
22
22
|
export function useAuth() {
|
|
23
23
|
const authState = useAuthState();
|
|
24
|
-
const { localStorage } = useQuasar();
|
|
25
24
|
|
|
26
25
|
const { t } = useI18n();
|
|
27
26
|
const {
|
|
@@ -92,12 +91,12 @@ export function useAuth() {
|
|
|
92
91
|
// @ts-ignore
|
|
93
92
|
if (!window.Cypress) {
|
|
94
93
|
const isDifferentUser =
|
|
95
|
-
!localStorage.
|
|
94
|
+
!localStorage.getItem("credentials") ||
|
|
96
95
|
// @ts-ignore
|
|
97
|
-
localStorage.getItem("credentials").email !== data.auth.email;
|
|
96
|
+
JSON.parse(localStorage.getItem("credentials")).email !== data.auth.email;
|
|
98
97
|
|
|
99
98
|
if (isDifferentUser) {
|
|
100
|
-
localStorage.
|
|
99
|
+
localStorage.setItem("credentials", JSON.stringify(data.auth));
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
push(LOCAL_SUCCESS_REDIRECTION_ROUTE);
|
|
@@ -117,11 +116,11 @@ export function useAuth() {
|
|
|
117
116
|
};
|
|
118
117
|
|
|
119
118
|
const deviceReady = () => {
|
|
120
|
-
if (localStorage.
|
|
119
|
+
if (localStorage.getItem("credentials")) {
|
|
121
120
|
// @ts-ignore
|
|
122
|
-
email.value = localStorage.getItem("credentials").email;
|
|
121
|
+
email.value = JSON.parse(localStorage.getItem("credentials")).email;
|
|
123
122
|
// @ts-ignore
|
|
124
|
-
password.value = localStorage.getItem("credentials").password;
|
|
123
|
+
password.value = JSON.parse(localStorage.getItem("credentials")).password;
|
|
125
124
|
}
|
|
126
125
|
};
|
|
127
126
|
|