mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-09 07:26:01 -04:00
Merge branch 'auth-method-count-warning' into 'main'
(auth)(ux) warn users if they only have a single login method set up See merge request PronounsPage/PronounsPage!569
This commit is contained in:
commit
be8b95c445
@ -206,6 +206,9 @@
|
||||
<template #cards-header>
|
||||
<Icon v="id-card" />
|
||||
<T>profile.list</T>
|
||||
<span v-if="profiles !== undefined" class="badge text-bg-light">
|
||||
{{ Object.keys(profiles).length }}
|
||||
</span>
|
||||
</template>
|
||||
<template #cards>
|
||||
<Loading :value="profiles">
|
||||
@ -226,10 +229,22 @@
|
||||
<template #socials-header>
|
||||
<Icon v="sign-in-alt" />
|
||||
<T>user.socialConnection.header</T>
|
||||
<template v-if="authMethodsCount !== null">
|
||||
<span v-if="authMethodsCount < 2" class="badge text-bg-warning">
|
||||
<Icon v="exclamation-triangle" />
|
||||
</span>
|
||||
<span v-else class="badge text-bg-light">
|
||||
{{ authMethodsCount }}
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #socials>
|
||||
<Loading :value="socialConnections">
|
||||
<template #header>
|
||||
<div v-if="authMethodsCount !== null && authMethodsCount < 2" class="alert alert-warning">
|
||||
<Icon v="exclamation-triangle" />
|
||||
<T>user.tooFewAuthMethods</T>
|
||||
</div>
|
||||
<div class="form-check form-switch my-2">
|
||||
<label>
|
||||
<input v-model="socialLookup" class="form-check-input" type="checkbox" role="switch">
|
||||
@ -239,7 +254,37 @@
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
<ul v-if="socialConnections !== undefined" class="list-group">
|
||||
<ul v-if="socialConnections !== null" class="list-group">
|
||||
<li :class="['list-group-item', hasEmail ? 'profile-current' : '']">
|
||||
<div class="d-md-flex justify-content-between align-items-center">
|
||||
<h4 class="my-md-0 d-flex align-items-center gap-2">
|
||||
<Icon v="envelope" />
|
||||
<T>user.account.changeEmail.header</T>
|
||||
</h4>
|
||||
|
||||
<span v-if="hasEmail">
|
||||
<span class="me-2">
|
||||
{{ user.email }}
|
||||
</span>
|
||||
<a
|
||||
href="#general"
|
||||
class="btn btn-light border"
|
||||
>
|
||||
<Icon v="edit" />
|
||||
<T>user.account.changeEmail.action</T>
|
||||
</a>
|
||||
</span>
|
||||
<span v-else>
|
||||
<a
|
||||
href="#general"
|
||||
class="btn btn-light border border-warning"
|
||||
>
|
||||
<Icon v="mailbox" />
|
||||
<T>user.account.changeEmail.confirm</T>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
<li v-for="(providerOptions, provider) in socialProviders" :key="provider" :class="['list-group-item', socialConnections[provider] !== undefined ? 'profile-current' : '']">
|
||||
<SocialConnection
|
||||
:provider="provider"
|
||||
@ -385,6 +430,15 @@ export default defineComponent({
|
||||
}
|
||||
return null;
|
||||
},
|
||||
hasEmail() {
|
||||
return this.user?.email && !this.user.email.endsWith('.oauth');
|
||||
},
|
||||
authMethodsCount() {
|
||||
if (!this.user || this.socialConnections === null) {
|
||||
return null;
|
||||
}
|
||||
return Object.keys(this.socialConnections).length + (this.hasEmail ? 1 : 0);
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
email(v) {
|
||||
|
@ -600,6 +600,7 @@ user:
|
||||
headerLong: 'Your account'
|
||||
tokenExpired: 'Token has expired. Please refresh the website and try again.'
|
||||
tooManyAttempts: 'Too many attempts. Access to your account has been temporarily locked. Please try again later.'
|
||||
tooFewAuthMethods: 'We recommend connecting at least two authentication method so that you have a backup option.'
|
||||
login:
|
||||
help: 'To log in or create an account you can either use the social media buttons or enter your email in the field below and then confirm the code you will have received in your mailbox.'
|
||||
placeholder: 'Email (or username, if you''re already registered)'
|
||||
@ -643,6 +644,7 @@ user:
|
||||
action: 'Change email'
|
||||
invalid: 'Invalid email address.'
|
||||
taken: 'This address is taken.'
|
||||
confirm: 'Confirm your email'
|
||||
logout: 'Log out @%username%'
|
||||
logoutAll: 'Log out from all accounts'
|
||||
avatar:
|
||||
|
@ -804,6 +804,7 @@ user:
|
||||
headerLong: 'Your account'
|
||||
tokenExpired: 'Token has expired. Please refresh the website and try again.'
|
||||
tooManyAttempts: 'Too many attempts. Access to your account has been temporarily locked. Please try again later.'
|
||||
tooFewAuthMethods: 'We recommend connecting at least two authentication method so that you have a backup option.'
|
||||
login:
|
||||
help: 'To log in or create an account you can either use the social media buttons or enter your email in the field below and then confirm the code you will have received in your mailbox.'
|
||||
placeholder: 'Email (or username, if you''re already registered)'
|
||||
@ -847,6 +848,7 @@ user:
|
||||
action: 'Change email'
|
||||
invalid: 'Invalid email address.'
|
||||
taken: 'This address is taken.'
|
||||
confirm: 'Confirm your email'
|
||||
logout: 'Log out @%username%'
|
||||
logoutAll: 'Log out from all accounts'
|
||||
avatar:
|
||||
|
@ -1441,6 +1441,7 @@ user:
|
||||
headerLong: 'Twoje konto'
|
||||
tokenExpired: 'Sesja wygasła. Odśwież stronę i spróbuj ponownie.'
|
||||
tooManyAttempts: 'Zbyt wiele prób. Dostęp do Twojego konta został tymczasowo zablokowany. Spróbuj później.'
|
||||
tooFewAuthMethods: 'Zalecamy podpięcie co najmniej dwóch metod logowania, aby mieć opcję zapasową.'
|
||||
login:
|
||||
help: 'Aby zalogować się lub założyć konto, użyj opcji logowania za pomocą mediów społecznościowych lub wpisz swój email w polu poniżej, a następnie potwierdź kod, który otrzymasz na swoją skrzynkę.'
|
||||
placeholder: 'Email (lub nazwa użytkownicza, jeśli już posiadasz konto)'
|
||||
@ -1483,6 +1484,7 @@ user:
|
||||
action: 'Zmień email'
|
||||
invalid: 'Nieprawidłowy adres email.'
|
||||
taken: 'Ten adres jest zajęty.'
|
||||
confirm: 'Potwierdź swój adres'
|
||||
logout: 'Wyloguj @%username%'
|
||||
logoutAll: 'Wyloguj ze wszystkich kont'
|
||||
avatar:
|
||||
|
Loading…
x
Reference in New Issue
Block a user