feat: new login complete UI (wip)

pull/2213/head
NGPixel 4 years ago
parent 4cd6fe8a56
commit e9044698c9

@ -58,14 +58,13 @@
)
v-btn.mt-2.text-none(
width='100%'
v-if='screen === "login"'
large
color='primary'
dark
@click='login'
:loading='isLoading'
) {{ $t('auth:actions.login') }}
.text-center.mt-5(v-if='screen === "login"')
.text-center.mt-5
v-btn.text-none(
text
rounded
@ -74,153 +73,111 @@
href='#forgot'
): .caption {{ $t('auth:forgotPasswordLink') }}
v-btn.text-none(
v-if='screen === "login" && selectedStrategyKey === `local` && selectedStrategy.selfRegistration'
v-if='selectedStrategyKey === `local` && selectedStrategy.selfRegistration'
color='indigo darken-2'
text
rounded
href='/register'
): .caption {{ $t('auth:switchToRegister.link') }}
//- .login-main
//- v-container(grid-list-lg, fluid)
//- v-row(no-gutters)
//- v-col(cols='12', xl='4')
//- transition(name='fadeUp')
//- v-card.elevation-5(v-show='isShown', light)
//- v-toolbar(color='indigo', flat, dense, dark)
//- v-spacer
//- .subheading(v-if='screen === "tfa"') {{ $t('auth:tfa.subtitle') }}
//- .subheading(v-if='screen === "changePwd"') {{ $t('auth:changePwd.subtitle') }}
//- .subheading(v-else-if='selectedStrategy.key !== "local"') {{ $t('auth:loginUsingStrategy', { strategy: selectedStrategy.title, interpolation: { escapeValue: false } }) }}
//- .subheading(v-else) {{ $t('auth:loginRequired') }}
//- v-spacer
//- v-card-text.text-center
//- h1.display-1.indigo--text.py-2 {{ siteTitle }}
//- template(v-if='screen === "login"')
//- v-text-field.mt-3(
//- solo
//- flat
//- prepend-icon='mdi-clipboard-account'
//- background-color='grey lighten-4'
//- hide-details
//- ref='iptEmail'
//- v-model='username'
//- :placeholder='$t("auth:fields.emailUser")'
//- )
//- v-text-field.mt-2(
//- solo
//- flat
//- prepend-icon='mdi-textbox-password'
//- background-color='grey lighten-4'
//- hide-details
//- ref='iptPassword'
//- v-model='password'
//- :append-icon='hidePassword ? "mdi-eye-off" : "mdi-eye"'
//- @click:append='() => (hidePassword = !hidePassword)'
//- :type='hidePassword ? "password" : "text"'
//- :placeholder='$t("auth:fields.password")'
//- @keyup.enter='login'
//- )
//- template(v-else-if='screen === "tfa"')
//- .body-2 Enter the security code generated from your trusted device:
//- v-text-field.centered.mt-2(
//- solo
//- flat
//- background-color='grey lighten-4'
//- hide-details
//- ref='iptTFA'
//- v-model='securityCode'
//- :placeholder='$t("auth:tfa.placeholder")'
//- @keyup.enter='verifySecurityCode'
//- )
//- template(v-else-if='screen === "changePwd"')
//- .body-2 {{$t('auth:changePwd.instructions')}}
//- v-text-field.mt-2(
//- type='password'
//- solo
//- flat
//- background-color='grey lighten-4'
//- hide-details
//- ref='iptNewPassword'
//- v-model='newPassword'
//- :placeholder='$t(`auth:changePwd.newPasswordPlaceholder`)'
//- )
//- v-text-field.mt-2(
//- type='password'
//- solo
//- flat
//- background-color='grey lighten-4'
//- hide-details
//- v-model='newPasswordVerify'
//- :placeholder='$t(`auth:changePwd.newPasswordVerifyPlaceholder`)'
//- @keyup.enter='changePassword'
//- )
//- template(v-else-if='screen === "forgot"')
//- .body-2 {{ $t('auth:forgotPasswordSubtitle') }}
//- v-text-field.mt-3(
//- solo
//- flat
//- prepend-icon='mdi-email'
//- background-color='grey lighten-4'
//- hide-details
//- ref='iptEmailForgot'
//- v-model='username'
//- :placeholder='$t("auth:fields.email")'
//- )
//- v-card-actions.pb-4
//- v-spacer
//- v-btn(
//- width='100%'
//- max-width='250px'
//- v-if='screen === "login"'
//- large
//- color='primary'
//- dark
//- @click='login'
//- rounded
//- :loading='isLoading'
//- ) {{ $t('auth:actions.login') }}
//- v-btn(
//- width='100%'
//- max-width='250px'
//- v-else-if='screen === "tfa"'
//- large
//- color='primary'
//- dark
//- @click='verifySecurityCode'
//- rounded
//- :loading='isLoading'
//- ) {{ $t('auth:tfa.verifyToken') }}
//- v-btn(
//- width='100%'
//- max-width='250px'
//- v-else-if='screen === "changePwd"'
//- large
//- color='primary'
//- dark
//- @click='changePassword'
//- rounded
//- :loading='isLoading'
//- ) {{ $t('auth:changePwd.proceed') }}
//- v-btn(
//- width='100%'
//- max-width='250px'
//- v-else-if='screen === "forgot"'
//- large
//- color='primary'
//- dark
//- @click='forgotPasswordSubmit'
//- rounded
//- :loading='isLoading'
//- ) {{ $t('auth:sendResetPassword') }}
//- v-spacer
//- v-card-actions.pb-3(v-if='screen === "login" && selectedStrategy.key === "local"')
//- v-spacer
//- a.caption(@click.stop.prevent='forgotPassword', href='#forgot') {{ $t('auth:forgotPasswordLink') }}
//- v-spacer
//- v-card-actions.pb-3(v-else-if='screen === "forgot"')
//- v-spacer
//- a.caption(@click.stop.prevent='screen = `login`', href='#cancelforgot') {{ $t('auth:forgotPasswordCancel') }}
//- v-spacer
//-------------------------------------------------
//- FORGOT PASSWORD FORM
//-------------------------------------------------
template(v-if='screen === `forgot`')
.login-subtitle
.text-subtitle-1 Forgot your password
.login-info {{ $t('auth:forgotPasswordSubtitle') }}
.login-form
v-text-field(
solo
flat
prepend-inner-icon='mdi-clipboard-account'
background-color='white'
hide-details
ref='iptForgotPwdEmail'
v-model='username'
:placeholder='$t(selectedStrategy.strategy.usernameLabel)'
)
v-btn.mt-2.text-none(
width='100%'
large
color='primary'
dark
@click='forgotPasswordSubmit'
:loading='isLoading'
) {{ $t('auth:sendResetPassword') }}
.text-center.mt-5
v-btn.text-none(
text
rounded
color='grey darken-3'
@click.stop.prevent='screen = `login`'
href='#forgot'
): .caption {{ $t('auth:forgotPasswordCancel') }}
//-------------------------------------------------
//- CHANGE PASSWORD FORM
//-------------------------------------------------
template(v-if='screen === `changePwd`')
.login-subtitle
.text-subtitle-1 {{ $t('auth:changePwd.subtitle') }}
.login-form
v-text-field.mt-2(
type='password'
solo
flat
prepend-inner-icon='mdi-form-textbox-password'
background-color='white'
hide-details
ref='iptNewPassword'
v-model='newPassword'
:placeholder='$t(`auth:changePwd.newPasswordPlaceholder`)'
)
password-strength(slot='progress', v-model='newPassword')
v-text-field.mt-2(
type='password'
solo
flat
prepend-inner-icon='mdi-form-textbox-password'
background-color='white'
hide-details
v-model='newPasswordVerify'
:placeholder='$t(`auth:changePwd.newPasswordVerifyPlaceholder`)'
@keyup.enter='changePassword'
)
v-btn.mt-2.text-none(
width='100%'
large
color='primary'
dark
@click='changePassword'
:loading='isLoading'
) {{ $t('auth:changePwd.proceed') }}
//-------------------------------------------------
//- TFA FORM
//-------------------------------------------------
v-dialog(v-model='isTFAShown', max-width='500', persistent)
v-card
.login-tfa.text-center.pa-5
img(src='_assets/svg/icon-pin-pad.svg')
.subtitle-2 Enter the security code generated from your trusted device:
v-text-field.login-tfa-field.mt-2(
solo
flat
background-color='white'
hide-details
ref='iptTFA'
v-model='securityCode'
:placeholder='$t("auth:tfa.placeholder")'
@keyup.enter='verifySecurityCode'
)
v-btn.mt-2.text-none(
width='100%'
large
color='primary'
dark
@click='verifySecurityCode'
:loading='isLoading'
) {{ $t('auth:tfa.verifyToken') }}
loader(v-model='isLoading', :color='loaderColor', :title='loaderTitle', :subtitle='$t(`auth:pleaseWait`)')
notify
@ -265,7 +222,8 @@ export default {
loaderTitle: 'Working...',
isShown: false,
newPassword: '',
newPasswordVerify: ''
newPasswordVerify: '',
isTFAShown: false
}
},
computed: {
@ -307,9 +265,6 @@ export default {
},
mounted () {
this.isShown = true
this.$nextTick(() => {
// this.$refs.iptEmail.focus()
})
},
methods: {
/**
@ -614,6 +569,15 @@ export default {
border-bottom: 1px solid rgba(0,0,0,.3);
}
&-info {
border-top: 1px solid rgba(255,255,255,.85);
background-color: rgba(255,255,255,.15);
border-bottom: 1px solid rgba(0,0,0,.15);
padding: 12px;
font-size: 13px;
text-align: center;
}
&-list {
border-top: 1px solid rgba(255,255,255,.85);
padding: 12px;
@ -628,5 +592,14 @@ export default {
flex: 1 0 100vw;
height: 100vh;
}
&-tfa {
background-color: #EEE;
border: 7px solid #FFF;
&-field input {
text-align: center;
}
}
}
</style>

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="96px" height="96px"><path fill="#616161" d="M28.667,29H8.333C7.045,29,6,27.955,6,26.667V6.333C6,5.045,7.045,4,8.333,4h20.333C29.955,4,31,5.045,31,6.333v20.333C31,27.955,29.955,29,28.667,29z"/><path fill="#424242" d="M25,29V13c-2.2,0-4,1.8-4,4v12H25z"/><path fill="#e0e0e0" d="M13 12h-3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C14 11.55 13.55 12 13 12zM20 12h-3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C21 11.55 20.55 12 20 12zM27 12h-3c-.55 0-1-.45-1-1V8c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C28 11.55 27.55 12 27 12zM13 19h-3c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C14 18.55 13.55 19 13 19zM20 19h-3c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C21 18.55 20.55 19 20 19zM13 26h-3c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C14 25.55 13.55 26 13 26zM20 26h-3c-.55 0-1-.45-1-1v-3c0-.55.45-1 1-1h3c.55 0 1 .45 1 1v3C21 25.55 20.55 26 20 26z"/><path fill="#ffcc80" d="M37,28v-2H26l-3,2c0,0-2.268,1.422-3.286,2.67c-0.906,1.021-1.021,2.303,0,3.666C19.714,34.336,24,44,29,44h7.128c3.743,0,6.862-3.035,6.862-6.775c0,0,0.01-4.811,0.01-9.225H37z"/><path fill="#ffcc80" d="M23 31.75c0 1.336 1.127 2.43 2.5 2.43 1.378 0 2.5-1.094 2.5-2.43l-.01-16.324c0-1.332-1.112-2.426-2.49-2.426-1.373 0-2.5 1.094-2.5 2.426V31.75zM28 33.93c0 1.336 1.127 2.43 2.5 2.43 1.378 0 2.5-1.094 2.5-2.43v-8.324c0-1.332-1.122-2.426-2.5-2.426-1.373 0-2.5 1.094-2.5 2.426V33.93zM33 33.93c0 1.336 1.127 2.43 2.5 2.43 1.378 0 2.5-1.094 2.5-2.43v-8.324c0-1.332-1.122-2.426-2.5-2.426-1.373 0-2.5 1.094-2.5 2.426V33.93z"/><path fill="#ffcc80" d="M37.99,34.93c0,1.336,1.127,2.43,2.5,2.43c1.378,0,2.5-1.094,2.5-2.43v-8.324c0-1.332-1.122-2.426-2.5-2.426c-1.373,0-2.5,1.094-2.5,2.426V34.93z"/><path fill="#ffebee" d="M24,15.578c0.01-0.781,0.685-1.408,1.516-1.398c0.827,0.008,1.492,0.65,1.484,1.428C26.988,16.391,23.991,16.359,24,15.578"/><path fill="#f2a25a" d="M20.976,29.463C21.963,28.654,23,28,23,28v6.18L20.976,29.463z"/></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

Loading…
Cancel
Save