@sowell/quasar-app-extension-auth 0.4.3 → 0.4.4
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
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
:loading="loading"
|
|
93
93
|
type="submit"
|
|
94
94
|
class="full-width q-mt-lg"
|
|
95
|
-
:disable="isSubmitBtnDisabled()"
|
|
95
|
+
:disable="isSubmitBtnDisabled() || loading || msalLoading"
|
|
96
96
|
/>
|
|
97
97
|
<div
|
|
98
98
|
class="q-mb-lg q-mt-xl text-primary"
|
|
@@ -125,7 +125,8 @@
|
|
|
125
125
|
no-caps
|
|
126
126
|
unelevated
|
|
127
127
|
text-color="black"
|
|
128
|
-
:loading="
|
|
128
|
+
:loading="msalLoading"
|
|
129
|
+
:disable="msalLoading || loading"
|
|
129
130
|
:icon="`img:${MicrosoftLogo}`"
|
|
130
131
|
class="full-width q-mt-lg"
|
|
131
132
|
@click="msalAuth"
|
|
@@ -183,6 +184,7 @@ export default defineComponent({
|
|
|
183
184
|
email,
|
|
184
185
|
password,
|
|
185
186
|
loading,
|
|
187
|
+
msalLoading,
|
|
186
188
|
showPassword,
|
|
187
189
|
validations,
|
|
188
190
|
forgottenPassword,
|
|
@@ -233,6 +235,7 @@ export default defineComponent({
|
|
|
233
235
|
email,
|
|
234
236
|
password,
|
|
235
237
|
loading,
|
|
238
|
+
msalLoading,
|
|
236
239
|
showPassword,
|
|
237
240
|
validations,
|
|
238
241
|
forgottenPassword,
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
no-caps
|
|
18
18
|
unelevated
|
|
19
19
|
text-color="black"
|
|
20
|
-
:loading="
|
|
20
|
+
:loading="msalLoading"
|
|
21
|
+
:disable="msalLoading || loading"
|
|
21
22
|
:icon="`img:${MicrosoftLogo}`"
|
|
22
23
|
class="full-width q-mt-lg"
|
|
23
24
|
@click="msalAuth"
|
|
@@ -99,7 +100,7 @@
|
|
|
99
100
|
text-color="white"
|
|
100
101
|
:loading="loading"
|
|
101
102
|
type="submit"
|
|
102
|
-
:disable="isSubmitBtnDisabled()"
|
|
103
|
+
:disable="isSubmitBtnDisabled() || loading || msalLoading"
|
|
103
104
|
class="submitBtn text-subtitle2 text-weight-bold"
|
|
104
105
|
/>
|
|
105
106
|
<div
|
|
@@ -193,6 +194,7 @@ export default defineComponent({
|
|
|
193
194
|
email,
|
|
194
195
|
password,
|
|
195
196
|
loading,
|
|
197
|
+
msalLoading,
|
|
196
198
|
showPassword,
|
|
197
199
|
validations,
|
|
198
200
|
forgottenPassword,
|
|
@@ -275,6 +277,7 @@ export default defineComponent({
|
|
|
275
277
|
infoDialog,
|
|
276
278
|
password,
|
|
277
279
|
loading,
|
|
280
|
+
msalLoading,
|
|
278
281
|
showPassword,
|
|
279
282
|
validations,
|
|
280
283
|
submitBtnDisabled,
|
|
@@ -287,14 +290,14 @@ export default defineComponent({
|
|
|
287
290
|
isSubmitBtnDisabled,
|
|
288
291
|
requestedOtp,
|
|
289
292
|
goToOtpValidation,
|
|
290
|
-
resetPassword,
|
|
291
293
|
retypeEmail,
|
|
292
294
|
onSubmit,
|
|
293
295
|
icons,
|
|
294
296
|
USE_SSO,
|
|
295
297
|
MicrosoftLogo,
|
|
296
|
-
handleSubmit,
|
|
297
298
|
msalAuth,
|
|
299
|
+
resetPassword,
|
|
300
|
+
handleSubmit,
|
|
298
301
|
};
|
|
299
302
|
},
|
|
300
303
|
});
|
package/src/composables/auth.ts
CHANGED
|
@@ -54,6 +54,7 @@ export function useAuth() {
|
|
|
54
54
|
const password = ref("");
|
|
55
55
|
const msalToken = ref("");
|
|
56
56
|
const loading = ref(false);
|
|
57
|
+
const msalLoading = ref(false);
|
|
57
58
|
const showPassword = ref(false);
|
|
58
59
|
const forgottenPassword = ref(false);
|
|
59
60
|
const isReset = ref(false);
|
|
@@ -101,7 +102,9 @@ export function useAuth() {
|
|
|
101
102
|
};
|
|
102
103
|
|
|
103
104
|
const onSubmit = async (provider = "SoWell") => {
|
|
104
|
-
|
|
105
|
+
if (provider === "SoWell") {
|
|
106
|
+
loading.value = true;
|
|
107
|
+
}
|
|
105
108
|
const data: SignInPayload = {
|
|
106
109
|
auth: {
|
|
107
110
|
email: email.value,
|
|
@@ -133,6 +136,7 @@ export function useAuth() {
|
|
|
133
136
|
try {
|
|
134
137
|
await authState.signin(data, options);
|
|
135
138
|
loading.value = false;
|
|
139
|
+
msalLoading.value = false;
|
|
136
140
|
// @ts-ignore
|
|
137
141
|
if (!window.Cypress) {
|
|
138
142
|
// FIXME: encrypt password
|
|
@@ -145,6 +149,7 @@ export function useAuth() {
|
|
|
145
149
|
} catch (err) {
|
|
146
150
|
console.error("onSubmit", err);
|
|
147
151
|
loading.value = false;
|
|
152
|
+
msalLoading.value = false;
|
|
148
153
|
}
|
|
149
154
|
};
|
|
150
155
|
|
|
@@ -171,6 +176,7 @@ export function useAuth() {
|
|
|
171
176
|
};
|
|
172
177
|
|
|
173
178
|
const msalAuth = () => {
|
|
179
|
+
msalLoading.value = true;
|
|
174
180
|
msalState.signIn().then(
|
|
175
181
|
async (result) => {
|
|
176
182
|
email.value = result.email;
|
|
@@ -195,6 +201,7 @@ export function useAuth() {
|
|
|
195
201
|
email,
|
|
196
202
|
password,
|
|
197
203
|
loading,
|
|
204
|
+
msalLoading,
|
|
198
205
|
showPassword,
|
|
199
206
|
validations,
|
|
200
207
|
errorEmailMessage,
|
|
@@ -211,6 +218,8 @@ export function useAuth() {
|
|
|
211
218
|
IS_OTP,
|
|
212
219
|
LOCAL_OTP_ROUTE,
|
|
213
220
|
USE_SSO,
|
|
221
|
+
msalState,
|
|
222
|
+
msalAuth,
|
|
214
223
|
goToOtpValidation,
|
|
215
224
|
onSubmit,
|
|
216
225
|
retypeEmail,
|
|
@@ -223,7 +232,5 @@ export function useAuth() {
|
|
|
223
232
|
ionEyeSharp,
|
|
224
233
|
ionEyeOffSharp,
|
|
225
234
|
},
|
|
226
|
-
msalState,
|
|
227
|
-
msalAuth,
|
|
228
235
|
};
|
|
229
236
|
}
|