3
:dense="$vuetify.breakpoint.smAndDown"
14
@submit.prevent="handleLogin"
16
<div class="text-center">
17
<p v-html="$t('app.general.msg.welcome_back')" />
23
{{ $t('app.general.simple_form.error.credentials') }}
28
:label="$t('app.general.label.username')"
29
autocomplete="username"
40
:label="$t('app.general.label.password')"
41
autocomplete="current-password"
51
v-if="availableSources.length > 1"
53
:label="$t('app.general.label.auth_source')"
58
:items="availableSources.map(value => ({ text: $t(`app.general.label.${value}`), value }))"
75
{{ $t('app.general.btn.login') }}
81
class="custom-transform-class text-none"
82
:href="$globals.DOCS_AUTH_LOST_PASSWORD"
85
{{ $t('app.general.btn.forgot_password') }}
91
class="custom-transform-class text-none"
92
:href="$globals.DOCS_AUTH"
95
{{ $t('app.general.btn.auth_unsure') }}
104
import { Component, Vue } from 'vue-property-decorator'
105
import { appInit } from '@/init'
106
import { consola } from 'consola'
109
export default class Login extends Vue {
115
availableSources = [this.source]
118
const authInfo = await this.$store.dispatch('auth/getAuthInfo')
119
this.source = authInfo.defaultSource ?? this.source
120
this.availableSources = authInfo.availableSources ?? this.availableSources
123
async handleLogin () {
127
await this.$store.dispatch('auth/login', { username: this.username, password: this.password, source: this.source })
135
const instance = this.$store.getters['config/getCurrentInstance']
137
const config = await appInit(instance, this.$store.state.config.hostConfig)
139
// Reconnect the socket with the new instance url.
140
if (config.apiConnected && config.apiAuthenticated) {
141
consola.debug('Activating socket with config', config)
142
this.$socket.connect(config.apiConfig.socketUrl)
149
<style lang="scss" scoped>