Few fixes

This commit is contained in:
Antoine Nguyen
2023-07-06 14:06:15 +02:00
parent 09b3b12537
commit 989028e7e1
2 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
FROM base as build
RUN apk add --update openssl librrd python3-dev libffi-dev gcc g++ musl-dev libxml2-dev libxslt-dev \
libressl-dev jpeg-dev rrdtool-dev file make gettext freetype-dev cairo-dev \
libressl-dev jpeg-dev rrdtool-dev file make gettext freetype-dev cairo-dev cargo \
&& rm -rf /var/cache/apk/*
RUN python3 -m venv $VIRTUAL_ENV
WORKDIR /tmp
@@ -43,6 +43,7 @@
<validation-observer ref="observer">
<validation-provider
v-slot="{ errors }"
name="pin_code"
rules="required|numeric|minmax:6"
>
<v-text-field
@@ -95,6 +96,7 @@
v-model="password"
:error-messages="errors"
outlined
autocomplete="new-password"
/>
</validation-provider>
</validation-observer>
@@ -179,13 +181,19 @@ export default {
if (!valid) {
return
}
const resp = await account.finalizeTFASetup(this.pinCode)
this.key = null
this.qrURL = null
this.tokens = resp.data.tokens
Cookies.set('token', resp.data.access, { sameSite: 'strict' })
Cookies.set('refreshToken', resp.data.refresh, { sameSite: 'strict' })
this.$store.dispatch('auth/initialize')
try {
const resp = await account.finalizeTFASetup(this.pinCode)
this.key = null
this.qrURL = null
this.tokens = resp.data.tokens
Cookies.set('token', resp.data.access, { sameSite: 'strict' })
Cookies.set('refreshToken', resp.data.refresh, { sameSite: 'strict' })
this.$store.dispatch('auth/initialize')
} catch (err) {
if (err.response.status === 400) {
this.$refs.observer.setErrors(err.response.data)
}
}
},
async disableTFA () {
const isValid = await this.$refs.observer.validate()