Skip to content
Snippets Groups Projects
Commit f7c28bfa authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Warn about passwordless accounts

parent 9d8d171c
No related branches found
No related tags found
1 merge request!1699Warn about passwordless accounts
......@@ -13,4 +13,5 @@ export interface User extends UserLight {
is_admin: boolean
auth_token: string
features: Record<Feature, boolean>
has_usable_password: boolean
}
......@@ -17,11 +17,19 @@
to access more resources and tools.
</p>
</div>
<div class="email-warning notification is-info" v-if="emailWarning">
<div v-if="emailWarning" class="sticky-warning notification is-info">
<button class="delete" v-on:click="emailWarning = false"></button>
Welcome to Arkindex!
To fully activate your account, a verification email was sent to {{ user.email }}. <strong>Please check your mailbox</strong>.
</div>
<div v-else-if="passwordWarning" class="sticky-warning notification is-warning">
<button class="delete" v-on:click="passwordWarning = false"></button>
You don't have a password set for your account yet.
<strong>
Please define a password from
<router-link :to="{ name: 'user-profile' }">your profile page</router-link>.
</strong>
</div>
<router-view />
<footer class="footer is-paddingless is-flex is-justify-content-space-between">
<span class="footer-item">
......@@ -77,6 +85,7 @@ export default {
data: () => ({
VERSION,
loggingWarning: false,
passwordWarning: false,
emailWarning: false
}),
mounted () {
......@@ -110,6 +119,14 @@ export default {
this.loggingWarning = !loggedOn
this.emailWarning = loggedOn && !this.isVerified
}
},
user: {
immediate: true,
handler (newValue) {
if (!newValue) return
// Avoid confusion as profile page is only accessible to verified emails
this.passwordWarning = !this.emailWarning && !newValue.has_usable_password
}
}
}
}
......@@ -140,7 +157,7 @@ main.container, footer {
margin-top: 1em;
}
.email-warning {
.sticky-warning {
position: -webkit-sticky;
position: sticky;
top: 1rem;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment