@sowell/quasar-app-extension-auth 1.8.4 → 1.8.6
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/assets/restricted.svg +4 -0
- package/src/components/dialogs/Message.vue +95 -6
- package/src/components/dialogs/sw-info-dialog.vue +24 -2
- package/src/components/pages/AdminAuth.vue +39 -9
- package/src/components/pages/Auth.vue +9 -3
- package/src/components/pages/AuthReporter.vue +2 -0
- package/src/components/pages/WebAuth.vue +89 -7
- package/src/i18n/en-US/index.ts +5 -0
- package/src/i18n/fr-FR/index.ts +5 -0
package/package.json
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="82" height="82" viewBox="0 0 82 82" fill="none">
|
|
2
|
+
<path d="M20.467 13.2638C20.467 13.2638 32.783 22.7041 51.5063 5.05236C68.1346 -10.6241 81.7117 14.1097 81.8067 25.9544C81.9298 41.298 65.1784 53.5748 73.3078 63.6526C81.4372 73.7304 57.1861 90.3722 44.116 75.9698C27.8572 58.0538 23.4525 72.6106 14.185 72.6106C7.53374 72.6106 -6.12216 55.9168 3.09953 43.4971C10.8594 33.0461 6.6273 29.5776 4.57785 25.9544C1.62159 20.7288 8.64242 6.54534 20.467 13.2638Z" fill="#FFEFCF"/>
|
|
3
|
+
<path d="M63.1242 56.9728L44.1383 21.3586C42.7926 18.8336 39.2078 18.8336 37.861 21.3586L18.8762 56.9728C18.584 57.5209 18.4375 58.1363 18.4511 58.7587C18.4646 59.3811 18.6376 59.9894 18.9533 60.5241C19.269 61.0588 19.7165 61.5017 20.2522 61.8095C20.788 62.1174 21.3935 62.2797 22.0099 62.2806H59.9849C60.6017 62.2807 61.208 62.1191 61.7445 61.8116C62.281 61.5042 62.7293 61.0614 63.0457 60.5265C63.362 59.9916 63.5355 59.383 63.5493 58.7601C63.5631 58.1372 63.4166 57.5214 63.1242 56.9728V56.9728ZM41.0002 56.7669C40.5595 56.7669 40.1288 56.6349 39.7624 56.3876C39.396 56.1403 39.1104 55.7888 38.9418 55.3776C38.7732 54.9664 38.729 54.5139 38.815 54.0773C38.901 53.6408 39.1132 53.2397 39.4248 52.925C39.7364 52.6103 40.1333 52.3959 40.5655 52.3091C40.9977 52.2223 41.4457 52.2668 41.8528 52.4372C42.2599 52.6075 42.6079 52.896 42.8527 53.266C43.0975 53.6361 43.2282 54.0712 43.2282 54.5164C43.2282 54.8119 43.1706 55.1045 43.0586 55.3776C42.9466 55.6506 42.7825 55.8987 42.5756 56.1077C42.3687 56.3167 42.1231 56.4824 41.8528 56.5955C41.5825 56.7086 41.2928 56.7669 41.0002 56.7669ZM43.4198 34.1325L42.7804 47.8605C42.7804 48.338 42.5926 48.7959 42.2583 49.1336C41.924 49.4712 41.4707 49.6609 40.998 49.6609C40.5252 49.6609 40.0719 49.4712 39.7376 49.1336C39.4034 48.7959 39.2156 48.338 39.2156 47.8605L38.5761 34.1381C38.5618 33.8102 38.6129 33.4827 38.7265 33.1752C38.8401 32.8677 39.0138 32.5864 39.2373 32.3481C39.4608 32.1099 39.7295 31.9195 40.0274 31.7884C40.3253 31.6573 40.6463 31.5881 40.9712 31.5849H40.9946C41.3218 31.5847 41.6456 31.6515 41.9465 31.7812C42.2474 31.9109 42.5191 32.1009 42.7453 32.3396C42.9716 32.5783 43.1476 32.8608 43.2627 33.1701C43.3779 33.4794 43.4298 33.8091 43.4153 34.1392L43.4198 34.1325Z" fill="#FFBD3D"/>
|
|
4
|
+
</svg>
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
src="../../assets/success.svg"
|
|
13
13
|
style="width: 100px; height: 80px" />
|
|
14
14
|
<img
|
|
15
|
-
v-if="emailNotSend"
|
|
15
|
+
v-if="emailNotSend && !isForbidden"
|
|
16
16
|
src="../../assets/error.svg"
|
|
17
17
|
style="width: 100px; height: 80px" />
|
|
18
|
+
<img
|
|
19
|
+
v-if="isForbidden"
|
|
20
|
+
src="../../assets/restricted.svg"
|
|
21
|
+
style="width: 82px; height: 82px" />
|
|
18
22
|
</q-card-section>
|
|
19
23
|
|
|
20
24
|
<q-card-section class="q-pt-none q-pl-lg q-pr-lg">
|
|
@@ -30,7 +34,27 @@
|
|
|
30
34
|
data-testid="message-dialog"
|
|
31
35
|
class="text-subtitle1 q-mt-sm text-center"
|
|
32
36
|
style="font-size: 16px; font-weight: 400">
|
|
33
|
-
{{
|
|
37
|
+
{{ messageSubtitleParts.before
|
|
38
|
+
}}<strong>{{ messageSubtitleParts.bold }}</strong
|
|
39
|
+
>{{ messageSubtitleParts.after }}
|
|
40
|
+
</div>
|
|
41
|
+
<div v-if="isForbidden" class="forbidden-sso-section">
|
|
42
|
+
<div class="forbidden-sso-label">{{ $t("auth.continueWith") }}</div>
|
|
43
|
+
<q-btn
|
|
44
|
+
data-testid="forbidden-sso-btn"
|
|
45
|
+
data-cy="submit-sso-login"
|
|
46
|
+
unelevated
|
|
47
|
+
no-caps
|
|
48
|
+
dense
|
|
49
|
+
:loading="msalLoading"
|
|
50
|
+
:disable="msalLoading"
|
|
51
|
+
class="forbidden-sso-button"
|
|
52
|
+
@click="onMsalAuth">
|
|
53
|
+
<img
|
|
54
|
+
src="../../assets/logo-microsoft.svg"
|
|
55
|
+
class="forbidden-sso-icon" />
|
|
56
|
+
{{ $t("auth.microsoft") }}
|
|
57
|
+
</q-btn>
|
|
34
58
|
</div>
|
|
35
59
|
<div
|
|
36
60
|
class="q-mt-sm text-center q-mb-xl"
|
|
@@ -73,6 +97,8 @@
|
|
|
73
97
|
import { defineComponent, computed } from "vue"
|
|
74
98
|
import { useI18n } from "vue-i18n"
|
|
75
99
|
|
|
100
|
+
const FORBIDDEN_MESSAGE_BOLD_KEYWORD = "Microsoft"
|
|
101
|
+
|
|
76
102
|
export default defineComponent({
|
|
77
103
|
props: {
|
|
78
104
|
emailResetPassword: {
|
|
@@ -84,17 +110,22 @@ export default defineComponent({
|
|
|
84
110
|
loading: {
|
|
85
111
|
type: Boolean
|
|
86
112
|
},
|
|
113
|
+
msalLoading: {
|
|
114
|
+
type: Boolean
|
|
115
|
+
},
|
|
87
116
|
passwordUpdated: {
|
|
88
117
|
type: Boolean
|
|
89
118
|
}
|
|
90
119
|
},
|
|
91
|
-
emit: ["retypeEmail", "goToLoginPage", "close"],
|
|
120
|
+
emit: ["retypeEmail", "goToLoginPage", "close", "msalAuth"],
|
|
92
121
|
setup(props: any, { emit }: any) {
|
|
93
122
|
const { t } = useI18n()
|
|
94
123
|
|
|
124
|
+
const isForbidden = computed(() => props.sendEmailCode === 403)
|
|
125
|
+
|
|
95
126
|
const messageSubtitle = computed(() => {
|
|
96
127
|
if (props.sendEmailCode === 403) {
|
|
97
|
-
return t("auth.
|
|
128
|
+
return t("auth.restrictedDescription")
|
|
98
129
|
}
|
|
99
130
|
return props.sendEmailCode === 200
|
|
100
131
|
? t("auth.emailSent")
|
|
@@ -104,7 +135,7 @@ export default defineComponent({
|
|
|
104
135
|
})
|
|
105
136
|
const messageTitle = computed(() => {
|
|
106
137
|
if (props.sendEmailCode === 403) {
|
|
107
|
-
return t("auth.
|
|
138
|
+
return t("auth.restrictedTitle")
|
|
108
139
|
}
|
|
109
140
|
return props.sendEmailCode === 200
|
|
110
141
|
? t("auth.emailVerification")
|
|
@@ -113,6 +144,23 @@ export default defineComponent({
|
|
|
113
144
|
: t("auth.passwordChanged")
|
|
114
145
|
})
|
|
115
146
|
|
|
147
|
+
// The forbidden message names "Microsoft" - it is emphasised the same way
|
|
148
|
+
// as on the magic link restricted screen.
|
|
149
|
+
const messageSubtitleParts = computed(() => {
|
|
150
|
+
const message = messageSubtitle.value
|
|
151
|
+
const keywordIndex = message.indexOf(FORBIDDEN_MESSAGE_BOLD_KEYWORD)
|
|
152
|
+
if (!isForbidden.value || keywordIndex === -1) {
|
|
153
|
+
return { before: message, bold: "", after: "" }
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
before: message.slice(0, keywordIndex),
|
|
157
|
+
bold: FORBIDDEN_MESSAGE_BOLD_KEYWORD,
|
|
158
|
+
after: message.slice(
|
|
159
|
+
keywordIndex + FORBIDDEN_MESSAGE_BOLD_KEYWORD.length
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
|
|
116
164
|
const emailNotSend = computed(
|
|
117
165
|
() => props.sendEmailCode !== 200 && !props.passwordUpdated
|
|
118
166
|
)
|
|
@@ -124,6 +172,10 @@ export default defineComponent({
|
|
|
124
172
|
emit("retypeEmail")
|
|
125
173
|
}
|
|
126
174
|
|
|
175
|
+
const onMsalAuth = () => {
|
|
176
|
+
emit("msalAuth")
|
|
177
|
+
}
|
|
178
|
+
|
|
127
179
|
const handlePasswordUpdate = () => {
|
|
128
180
|
if (props.passwordUpdated) {
|
|
129
181
|
emit("goToLoginPage")
|
|
@@ -134,12 +186,49 @@ export default defineComponent({
|
|
|
134
186
|
|
|
135
187
|
return {
|
|
136
188
|
messageSubtitle,
|
|
189
|
+
messageSubtitleParts,
|
|
137
190
|
messageTitle,
|
|
138
191
|
emailNotSend,
|
|
139
192
|
emailSended,
|
|
193
|
+
isForbidden,
|
|
140
194
|
handlePasswordUpdate,
|
|
141
|
-
retypeEmail
|
|
195
|
+
retypeEmail,
|
|
196
|
+
onMsalAuth
|
|
142
197
|
}
|
|
143
198
|
}
|
|
144
199
|
})
|
|
145
200
|
</script>
|
|
201
|
+
|
|
202
|
+
<style scoped lang="scss">
|
|
203
|
+
.forbidden-sso-section {
|
|
204
|
+
margin-top: 24px;
|
|
205
|
+
text-align: center;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.forbidden-sso-label {
|
|
209
|
+
font-size: 15px;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
color: #112240;
|
|
212
|
+
margin-bottom: 12px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.forbidden-sso-button {
|
|
216
|
+
width: 180px;
|
|
217
|
+
height: 36px;
|
|
218
|
+
border-radius: 8px;
|
|
219
|
+
background: #ebeeef;
|
|
220
|
+
font-size: 12px;
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
color: #112240;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.forbidden-sso-button:hover {
|
|
226
|
+
background: #e0e5e7;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.forbidden-sso-icon {
|
|
230
|
+
width: 16px;
|
|
231
|
+
height: 16px;
|
|
232
|
+
margin-right: 8px;
|
|
233
|
+
}
|
|
234
|
+
</style>
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
class="text-subtitle1 q-mt-sm text-center text-dark"
|
|
30
30
|
data-testid="message-dialog"
|
|
31
31
|
>
|
|
32
|
-
{{
|
|
32
|
+
{{ contentParts.before
|
|
33
|
+
}}<strong>{{ contentParts.bold }}</strong>{{ contentParts.after }}
|
|
33
34
|
</div>
|
|
34
35
|
</q-card-section>
|
|
35
36
|
<q-card-actions class="row full-width justify-center q-mb-lg">
|
|
@@ -56,6 +57,7 @@ import { defineComponent, computed } from "vue";
|
|
|
56
57
|
import userNotFound from "../../assets/User-not-found.svg";
|
|
57
58
|
import passwordUpdated from "../../assets/Ok-illustration.svg";
|
|
58
59
|
import emailVerification from "../../assets/Email-sent.svg";
|
|
60
|
+
import restricted from "../../assets/restricted.svg";
|
|
59
61
|
import { ionCloseOutline } from "@quasar/extras/ionicons-v5";
|
|
60
62
|
|
|
61
63
|
export default defineComponent({
|
|
@@ -66,6 +68,9 @@ export default defineComponent({
|
|
|
66
68
|
image: { type: String, required: true },
|
|
67
69
|
passwordUpdated: { type: Boolean },
|
|
68
70
|
isOtp: { type: Boolean, default: false, required: false },
|
|
71
|
+
// Emphasises one word of `content` - used to bold "Microsoft" on the
|
|
72
|
+
// restricted / SSO-only message, like the magic link screens do.
|
|
73
|
+
boldKeyword: { type: String, default: "", required: false },
|
|
69
74
|
},
|
|
70
75
|
emit: ["goToLoginPage", "close"],
|
|
71
76
|
setup(props: any) {
|
|
@@ -79,12 +84,29 @@ export default defineComponent({
|
|
|
79
84
|
|
|
80
85
|
case "emailVerification":
|
|
81
86
|
return emailVerification;
|
|
87
|
+
|
|
88
|
+
case "restricted":
|
|
89
|
+
return restricted;
|
|
82
90
|
default:
|
|
83
91
|
return null
|
|
84
92
|
}
|
|
85
93
|
})
|
|
86
94
|
|
|
87
|
-
|
|
95
|
+
const contentParts = computed(() => {
|
|
96
|
+
const content = props.content as string;
|
|
97
|
+
const keyword = props.boldKeyword as string;
|
|
98
|
+
const keywordIndex = keyword ? content.indexOf(keyword) : -1;
|
|
99
|
+
if (keywordIndex === -1) {
|
|
100
|
+
return { before: content, bold: "", after: "" };
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
before: content.slice(0, keywordIndex),
|
|
104
|
+
bold: keyword,
|
|
105
|
+
after: content.slice(keywordIndex + keyword.length),
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return { imageValue, contentParts, icons: { ionCloseOutline } };
|
|
88
110
|
},
|
|
89
111
|
});
|
|
90
112
|
</script>
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
<q-layout>
|
|
3
3
|
<div class="row window-height">
|
|
4
4
|
<div class="col column content-center bgWhite">
|
|
5
|
-
<div class="q-mt-xl">
|
|
5
|
+
<div class="q-mt-xl logo-block">
|
|
6
6
|
<img src="../../assets/Sowell-logo.svg" style="width: 210px" />
|
|
7
7
|
</div>
|
|
8
|
-
<div
|
|
8
|
+
<div
|
|
9
|
+
class="column col content-center justify-center center"
|
|
10
|
+
:class="{ 'center-no-offset': isMagicLinkEnabled }">
|
|
9
11
|
<div class="q-pl-md q-pr-md" style="max-width: 500px">
|
|
10
12
|
<h4 class="title">{{ WELCOME_TITLE }}</h4>
|
|
11
13
|
<div class="subtitle">{{ WELCOME_SUBTITLE }}</div>
|
|
@@ -114,6 +116,7 @@
|
|
|
114
116
|
:content="infoDialog.content"
|
|
115
117
|
:image="infoDialog.image"
|
|
116
118
|
:isOtp="true"
|
|
119
|
+
:boldKeyword="infoDialog.isForbidden ? 'Microsoft' : ''"
|
|
117
120
|
>
|
|
118
121
|
<q-btn
|
|
119
122
|
v-if="requestedOtp"
|
|
@@ -134,6 +137,7 @@
|
|
|
134
137
|
|
|
135
138
|
<script lang="ts">
|
|
136
139
|
import { defineComponent, ref, computed } from "vue"
|
|
140
|
+
import { AxiosError } from "axios"
|
|
137
141
|
import { useI18n } from "vue-i18n"
|
|
138
142
|
import isEmail from "validator/es/lib/isEmail"
|
|
139
143
|
import { useAuthState } from "../../injects"
|
|
@@ -180,7 +184,8 @@ export default defineComponent({
|
|
|
180
184
|
const infoDialog = ref({
|
|
181
185
|
title: "",
|
|
182
186
|
content: "",
|
|
183
|
-
image: ""
|
|
187
|
+
image: "",
|
|
188
|
+
isForbidden: false
|
|
184
189
|
})
|
|
185
190
|
|
|
186
191
|
const submitBtnDisabled = computed(
|
|
@@ -204,6 +209,7 @@ export default defineComponent({
|
|
|
204
209
|
await authState.resetPassword(data).then(() => {
|
|
205
210
|
localStorage.setItem("emailResetPassword", email)
|
|
206
211
|
infoDialog.value = {
|
|
212
|
+
isForbidden: false,
|
|
207
213
|
title: t("auth.mailVerificationTitle"),
|
|
208
214
|
content:
|
|
209
215
|
IS_OTP.toLowerCase() === "y"
|
|
@@ -215,13 +221,25 @@ export default defineComponent({
|
|
|
215
221
|
isNotification.value = true
|
|
216
222
|
requestedOtp.value = true
|
|
217
223
|
})
|
|
218
|
-
} catch {
|
|
224
|
+
} catch (error) {
|
|
219
225
|
requestedOtp.value = false
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
226
|
+
// NOTE: 403 is returned when the company does not allow password reset
|
|
227
|
+
// (SSO-only account). The admin interface has no SSO entry point, so we
|
|
228
|
+
// only tell the user to reach out to their organisation.
|
|
229
|
+
infoDialog.value =
|
|
230
|
+
(error as AxiosError).response?.status === 403
|
|
231
|
+
? {
|
|
232
|
+
isForbidden: true,
|
|
233
|
+
title: t("auth.restrictedTitle"),
|
|
234
|
+
content: t("auth.restrictedDescription"),
|
|
235
|
+
image: "restricted"
|
|
236
|
+
}
|
|
237
|
+
: {
|
|
238
|
+
isForbidden: false,
|
|
239
|
+
title: t("auth.userNotFoundTitle"),
|
|
240
|
+
content: t("auth.userNotFoundSubtitle"),
|
|
241
|
+
image: "userNotFound"
|
|
242
|
+
}
|
|
225
243
|
isNotification.value = true
|
|
226
244
|
}
|
|
227
245
|
}
|
|
@@ -260,8 +278,20 @@ export default defineComponent({
|
|
|
260
278
|
margin-top: -115px;
|
|
261
279
|
}
|
|
262
280
|
|
|
281
|
+
/* Le bloc "Activer mon compte" (magiclink) rallonge la colonne : le decalage
|
|
282
|
+
negatif de recentrage faisait alors chevaucher le titre avec le logo. */
|
|
283
|
+
.center-no-offset {
|
|
284
|
+
margin-top: 0;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Le logo ne doit jamais etre compresse ni recouvert quand la colonne deborde. */
|
|
288
|
+
.logo-block {
|
|
289
|
+
flex: none;
|
|
290
|
+
}
|
|
291
|
+
|
|
263
292
|
.bgWhite {
|
|
264
293
|
background: #ffffff;
|
|
294
|
+
overflow-y: auto;
|
|
265
295
|
}
|
|
266
296
|
.bgBlue {
|
|
267
297
|
background: var(--q-primary);
|
|
@@ -150,7 +150,9 @@
|
|
|
150
150
|
:emailResetPassword="emailResetPassword"
|
|
151
151
|
:sendEmailCode="sendEmailCode"
|
|
152
152
|
:loading="loading"
|
|
153
|
-
|
|
153
|
+
:msalLoading="msalLoading"
|
|
154
|
+
@retypeEmail="retypeEmail"
|
|
155
|
+
@msalAuth="msalAuth"
|
|
154
156
|
@close="() => isReset= false"/>
|
|
155
157
|
</q-dialog>
|
|
156
158
|
</div>
|
|
@@ -169,6 +171,7 @@
|
|
|
169
171
|
|
|
170
172
|
<script lang="ts">
|
|
171
173
|
import { defineComponent, reactive, onMounted } from "vue"
|
|
174
|
+
import { AxiosError } from "axios"
|
|
172
175
|
import * as packageInfo from "app/package.json"
|
|
173
176
|
|
|
174
177
|
import SendEmail from "../dialogs/SendEmail.vue"
|
|
@@ -220,8 +223,11 @@ export default defineComponent({
|
|
|
220
223
|
sendEmailCode.value = 200
|
|
221
224
|
isReset.value = true
|
|
222
225
|
})
|
|
223
|
-
} catch {
|
|
224
|
-
|
|
226
|
+
} catch (error) {
|
|
227
|
+
// NOTE: 403 is returned when the company does not allow password reset
|
|
228
|
+
// (SSO-only account) - the dialog then offers the Microsoft login instead.
|
|
229
|
+
sendEmailCode.value =
|
|
230
|
+
(error as AxiosError).response?.status === 403 ? 403 : 404
|
|
225
231
|
isReset.value = true
|
|
226
232
|
}
|
|
227
233
|
}
|
|
@@ -169,7 +169,9 @@
|
|
|
169
169
|
:emailResetPassword="emailResetPassword"
|
|
170
170
|
:sendEmailCode="sendEmailCode"
|
|
171
171
|
:loading="loading"
|
|
172
|
+
:msalLoading="msalLoading"
|
|
172
173
|
@retypeEmail="retypeEmail"
|
|
174
|
+
@msalAuth="msalAuth"
|
|
173
175
|
@close="() => (isReset = false)">
|
|
174
176
|
<q-btn
|
|
175
177
|
v-if="sendEmailCode === 200 && isOtp"
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
<q-layout>
|
|
3
3
|
<div class="row window-height">
|
|
4
4
|
<div class="col column content-center bgWhite">
|
|
5
|
-
<div
|
|
5
|
+
<div
|
|
6
|
+
class="q-mt-xl custom-screen"
|
|
7
|
+
:class="{ 'custom-screen-compact': isMagicLinkEnabled }">
|
|
6
8
|
<img src="../../assets/Sowell-logo.svg" style="width: 210px" />
|
|
7
9
|
</div>
|
|
8
|
-
<div
|
|
10
|
+
<div
|
|
11
|
+
class="column col content-center justify-center center"
|
|
12
|
+
:class="{ 'center-no-offset': isMagicLinkEnabled }">
|
|
9
13
|
<div class="q-pl-md q-pr-md" style="max-width: 500px">
|
|
10
14
|
<h4 class="title">{{ WELCOME_TITLE }}</h4>
|
|
11
15
|
<div class="subtitle">{{ WELCOME_SUBTITLE }}</div>
|
|
@@ -154,10 +158,39 @@
|
|
|
154
158
|
:content="infoDialog.content"
|
|
155
159
|
:image="infoDialog.image"
|
|
156
160
|
:isOtp="isOtp"
|
|
161
|
+
:boldKeyword="infoDialog.isForbidden ? 'Microsoft' : ''"
|
|
157
162
|
@close="() => (isNotification = false)">
|
|
163
|
+
<div v-if="infoDialog.isForbidden" class="column items-center">
|
|
164
|
+
<div class="forbidden-sso-label">{{ $t("auth.connectWith") }}</div>
|
|
165
|
+
<q-btn
|
|
166
|
+
data-testid="forbidden-sso-btn"
|
|
167
|
+
data-cy="submit-sso-login"
|
|
168
|
+
unelevated
|
|
169
|
+
no-caps
|
|
170
|
+
dense
|
|
171
|
+
:loading="msalLoading"
|
|
172
|
+
:disable="msalLoading"
|
|
173
|
+
class="forbidden-sso-button"
|
|
174
|
+
@click="msalAuth">
|
|
175
|
+
<img
|
|
176
|
+
src="../../assets/logo-microsoft.svg"
|
|
177
|
+
class="forbidden-sso-icon" />
|
|
178
|
+
{{ $t("auth.microsoft") }}
|
|
179
|
+
</q-btn>
|
|
180
|
+
<q-btn
|
|
181
|
+
data-testid="close-btn"
|
|
182
|
+
class="bg-white submitBtn q-mt-md"
|
|
183
|
+
unelevated
|
|
184
|
+
outline
|
|
185
|
+
no-caps
|
|
186
|
+
:label="$t('auth.close')"
|
|
187
|
+
color="primary"
|
|
188
|
+
@click="() => (isNotification = false)"
|
|
189
|
+
v-close-popup />
|
|
190
|
+
</div>
|
|
158
191
|
<q-btn
|
|
159
192
|
:data-testid="infoDialog.canGoNext ? 'next-btn' : 'close-btn'"
|
|
160
|
-
v-if="isOtp"
|
|
193
|
+
v-else-if="isOtp"
|
|
161
194
|
class="bg-white submitBtn"
|
|
162
195
|
unelevated
|
|
163
196
|
outline
|
|
@@ -226,7 +259,8 @@ export default defineComponent({
|
|
|
226
259
|
const infoDialog = ref({
|
|
227
260
|
title: "",
|
|
228
261
|
content: "",
|
|
229
|
-
image: ""
|
|
262
|
+
image: "",
|
|
263
|
+
isForbidden: false
|
|
230
264
|
})
|
|
231
265
|
|
|
232
266
|
const isOtp = computed(() => IS_OTP.toLowerCase() === "y")
|
|
@@ -252,6 +286,7 @@ export default defineComponent({
|
|
|
252
286
|
localStorage.setItem("emailResetPassword", email)
|
|
253
287
|
infoDialog.value = {
|
|
254
288
|
canGoNext: true,
|
|
289
|
+
isForbidden: false,
|
|
255
290
|
title: t("auth.mailVerificationTitle"),
|
|
256
291
|
content:
|
|
257
292
|
IS_OTP.toLowerCase() === "y"
|
|
@@ -267,13 +302,15 @@ export default defineComponent({
|
|
|
267
302
|
// NOTE: 403 is returned when the user is not allowed to reset the password
|
|
268
303
|
infoDialog.value = {
|
|
269
304
|
canGoNext: false,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
305
|
+
isForbidden: true,
|
|
306
|
+
title: t("auth.restrictedTitle"),
|
|
307
|
+
content: t("auth.restrictedDescription"),
|
|
308
|
+
image: "restricted"
|
|
273
309
|
}
|
|
274
310
|
} else {
|
|
275
311
|
infoDialog.value = {
|
|
276
312
|
canGoNext: false,
|
|
313
|
+
isForbidden: false,
|
|
277
314
|
title: t("auth.userNotFoundTitle"),
|
|
278
315
|
content: t("auth.userNotFoundSubtitle"),
|
|
279
316
|
image: "userNotFound"
|
|
@@ -331,12 +368,52 @@ export default defineComponent({
|
|
|
331
368
|
</script>
|
|
332
369
|
|
|
333
370
|
<style scoped>
|
|
371
|
+
.forbidden-sso-label {
|
|
372
|
+
font-size: 15px;
|
|
373
|
+
font-weight: 600;
|
|
374
|
+
color: #112240;
|
|
375
|
+
margin-bottom: 12px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.forbidden-sso-button {
|
|
379
|
+
width: 260px;
|
|
380
|
+
max-width: 100%;
|
|
381
|
+
height: 36px;
|
|
382
|
+
border-radius: 8.85px;
|
|
383
|
+
background: #ebeeef;
|
|
384
|
+
font-size: 15px;
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
color: #112240;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.forbidden-sso-button:hover {
|
|
390
|
+
background: #e0e5e7;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.forbidden-sso-icon {
|
|
394
|
+
width: 18px;
|
|
395
|
+
height: 18px;
|
|
396
|
+
margin-right: 8px;
|
|
397
|
+
}
|
|
398
|
+
|
|
334
399
|
.center {
|
|
335
400
|
margin-top: -115px;
|
|
336
401
|
}
|
|
337
402
|
|
|
403
|
+
/* Le bloc "Activer mon compte" (magiclink) rallonge la colonne : le decalage
|
|
404
|
+
negatif de recentrage faisait alors chevaucher le titre avec le logo. */
|
|
405
|
+
.center-no-offset {
|
|
406
|
+
margin-top: 0;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/* Le logo ne doit jamais etre compresse ni recouvert quand la colonne deborde. */
|
|
410
|
+
.custom-screen {
|
|
411
|
+
flex: none;
|
|
412
|
+
}
|
|
413
|
+
|
|
338
414
|
.bgWhite {
|
|
339
415
|
background: #ffffff;
|
|
416
|
+
overflow-y: auto;
|
|
340
417
|
}
|
|
341
418
|
.bgBlue {
|
|
342
419
|
background: var(--q-primary);
|
|
@@ -368,6 +445,11 @@ export default defineComponent({
|
|
|
368
445
|
margin-top: 15px;
|
|
369
446
|
margin-bottom: 125px;
|
|
370
447
|
}
|
|
448
|
+
/* Avec le bloc magiclink la colonne est bien plus haute : la grande marge
|
|
449
|
+
sous le logo ferait deborder le formulaire hors de l'ecran. */
|
|
450
|
+
.custom-screen-compact {
|
|
451
|
+
margin-bottom: 24px;
|
|
452
|
+
}
|
|
371
453
|
.subtitle {
|
|
372
454
|
margin-bottom: 20px !important;
|
|
373
455
|
}
|
package/src/i18n/en-US/index.ts
CHANGED
|
@@ -49,6 +49,11 @@ export default {
|
|
|
49
49
|
back: "Back",
|
|
50
50
|
backToLoginFull: "Back to login",
|
|
51
51
|
continueWith: "Or continue with",
|
|
52
|
+
connectWith: "Sign in with",
|
|
53
|
+
microsoft: "Microsoft",
|
|
54
|
+
restrictedTitle: "Reset unavailable",
|
|
55
|
+
restrictedDescription:
|
|
56
|
+
"Your account uses Microsoft login. You are not allowed to manage your password. To change it, contact your administrator.",
|
|
52
57
|
emailOrPasswordIncorrect: "Email or password incorrect",
|
|
53
58
|
magicLinkCheckSmsMessage: "Check your text messages",
|
|
54
59
|
magicLinkWarningSms:
|
package/src/i18n/fr-FR/index.ts
CHANGED
|
@@ -52,6 +52,11 @@ export default {
|
|
|
52
52
|
back: "Retour",
|
|
53
53
|
backToLoginFull: "Retour à la connexion",
|
|
54
54
|
continueWith: "Ou continuer avec",
|
|
55
|
+
connectWith: "Se connecter avec",
|
|
56
|
+
microsoft: "Microsoft",
|
|
57
|
+
restrictedTitle: "Réinitialisation impossible",
|
|
58
|
+
restrictedDescription:
|
|
59
|
+
"Votre compte utilise la connexion Microsoft. La gestion de votre mot de passe vous est interdite. Pour le modifier, contactez votre administrateur.",
|
|
55
60
|
emailOrPasswordIncorrect: "Email ou mot de passe incorrect",
|
|
56
61
|
magicLinkCheckSmsMessage: "Vérifiez vos messages",
|
|
57
62
|
magicLinkWarningSms:
|