@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sowell/quasar-app-extension-auth",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "A Quasar app extension to manage Authentication",
5
5
  "main": "src/index.js",
6
6
  "repository": "https://github.com/sowell-ai/quasar.extension.auth",
@@ -9,7 +9,7 @@ import {
9
9
  ionEyeSharp,
10
10
  ionEyeOffSharp,
11
11
  } from "@quasar/extras/ionicons-v5";
12
- import { useQuasar, Platform } from "quasar";
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.has("credentials") ||
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.set("credentials", data.auth);
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.has("credentials")) {
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