mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
103 lines
2.5 KiB
Vue
103 lines
2.5 KiB
Vue
<template>
|
|
<section class="login-form">
|
|
<blockquote>
|
|
<p>{{ $t('quotes.african.quote') }}</p>
|
|
<b>- {{ $t('quotes.african.author') }}</b>
|
|
</blockquote>
|
|
<base-card>
|
|
<template #imageColumn>
|
|
<a :href="links.ORGANIZATION" :title="$t('login.moreInfo', metadata)" target="_blank">
|
|
<img class="image" alt="Welcome" src="/img/custom/welcome.svg" />
|
|
</a>
|
|
</template>
|
|
<h2 class="title">{{ $t('login.login') }}</h2>
|
|
<form :disabled="pending" @submit.prevent="onSubmit">
|
|
<ds-input
|
|
v-model="form.email"
|
|
:disabled="pending"
|
|
:placeholder="$t('login.email')"
|
|
type="email"
|
|
name="email"
|
|
icon="envelope"
|
|
/>
|
|
<ds-input
|
|
v-model="form.password"
|
|
:disabled="pending"
|
|
:placeholder="$t('login.password')"
|
|
icon="lock"
|
|
icon-right="question-circle"
|
|
name="password"
|
|
type="password"
|
|
/>
|
|
<nuxt-link to="/password-reset/request">
|
|
{{ $t('login.forgotPassword') }}
|
|
</nuxt-link>
|
|
<base-button :loading="pending" filled name="submit" type="submit" icon="sign-in">
|
|
{{ $t('login.login') }}
|
|
</base-button>
|
|
<p>
|
|
{{ $t('login.no-account') }}
|
|
<nuxt-link to="/registration/signup">{{ $t('login.register') }}</nuxt-link>
|
|
</p>
|
|
</form>
|
|
<template #topMenu>
|
|
<locale-switch offset="5" />
|
|
</template>
|
|
</base-card>
|
|
</section>
|
|
</template>
|
|
|
|
<script>
|
|
import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch'
|
|
import links from '~/constants/links.js'
|
|
import metadata from '~/constants/metadata.js'
|
|
|
|
export default {
|
|
components: {
|
|
LocaleSwitch,
|
|
},
|
|
data() {
|
|
return {
|
|
metadata,
|
|
links,
|
|
form: {
|
|
email: '',
|
|
password: '',
|
|
},
|
|
}
|
|
},
|
|
computed: {
|
|
pending() {
|
|
return this.$store.getters['auth/pending']
|
|
},
|
|
},
|
|
methods: {
|
|
async onSubmit() {
|
|
const { email, password } = this.form
|
|
try {
|
|
await this.$store.dispatch('auth/login', { email, password })
|
|
this.$toast.success(this.$t('login.success'))
|
|
this.$emit('success')
|
|
} catch (err) {
|
|
this.$toast.error(this.$t('login.failure'))
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.login-form {
|
|
width: 80vw;
|
|
max-width: 620px;
|
|
margin: auto;
|
|
|
|
.base-button {
|
|
display: block;
|
|
width: 100%;
|
|
margin-top: $space-large;
|
|
margin-bottom: $space-small;
|
|
}
|
|
}
|
|
</style>
|