Skip to content

Commit

Permalink
Update login with device page styles
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Jun 21, 2021
1 parent 365819c commit d157625
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
4 changes: 4 additions & 0 deletions core/css/guest.css
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ form #selectDbType label span {
.groupbottom input[type=submit] {
box-shadow: none !important;
}
.grouptop.groupbottom input {
border-radius: 3px !important;
margin: 5px 0 !important;
}

#install-recommended-apps + label span {
display: inline-block;
Expand Down
33 changes: 26 additions & 7 deletions core/src/components/login/PasswordLessLoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@submit.prevent="submit">
<fieldset>
<p class="grouptop groupbottom">
<label for="user" class="infield">{{ t('core', 'Username or email') }}</label>
<input id="user"
ref="user"
v-model="user"
Expand All @@ -16,10 +17,9 @@
:aria-label="t('core', 'Username or email')"
required
@change="$emit('update:username', user)">
<label for="user" class="infield">{{ t('core', 'Username or email') }}</label>
</p>

<div v-if="!validCredentials">
<div v-if="!validCredentials" class="body-login-container update form__message-box">
{{ t('core', 'Your account is not setup for passwordless login.') }}
</div>

Expand All @@ -29,11 +29,19 @@
@click="authenticate" />
</fieldset>
</form>
<div v-else-if="!hasPublicKeyCredential">
{{ t('core', 'Passwordless authentication is not supported in your browser.') }}
<div v-else-if="!hasPublicKeyCredential" class="body-login-container update">
<InformationIcon size="70" />
<h2>{{ t('core', 'Browser not supported') }}</h2>
<p class="infogroup">
{{ t('core', 'Passwordless authentication is not supported in your browser.') }}
</p>
</div>
<div v-else-if="!isHttps && !isLocalhost">
{{ t('core', 'Passwordless authentication is only available over a secure connection.') }}
<div v-else-if="!isHttps && !isLocalhost" class="body-login-container update">
<LockOpenIcon size="70" />
<h2>{{ t('core', 'Your connection is not secure') }}</h2>
<p class="infogroup">
{{ t('core', 'Passwordless authentication is only available over a secure connection.') }}
</p>
</div>
</template>

Expand All @@ -43,6 +51,8 @@ import {
finishAuthentication,
} from '../../services/WebAuthnAuthenticationService'
import LoginButton from './LoginButton'
import InformationIcon from 'vue-material-design-icons/Information'
import LockOpenIcon from 'vue-material-design-icons/LockOpen'
class NoValidCredentials extends Error {
Expand All @@ -52,6 +62,8 @@ export default {
name: 'PasswordLessLoginForm',
components: {
LoginButton,
InformationIcon,
LockOpenIcon,
},
props: {
username: {
Expand Down Expand Up @@ -211,6 +223,13 @@ export default {
}
</script>

<style scoped>
<style lang="scss" scoped>
.body-login-container.update {
margin: 15px 0;
&.form__message-box {
width: 240px;
margin: 5px;
}
}
</style>

0 comments on commit d157625

Please sign in to comment.