Fix login errors not showing

This commit is contained in:
Pavle Portic 2019-03-24 21:09:28 +01:00
parent 839425cf1d
commit 5bf978aabe
Signed by: TheEdgeOfRage
GPG Key ID: 6758ACE46AA2A849
2 changed files with 6 additions and 3 deletions

View File

@ -5,7 +5,7 @@ services:
container_name: perktree-db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: perktree-root-password
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: perktree
volumes:
- /mnt/perktree/db:/var/lib/mysql

View File

@ -20,7 +20,7 @@
v-for="(error, index) in loginErrors"
:key="index"
class="login-errors"
>{{ error.description }}</p>
>{{ error }}</p>
<v-btn type="submit">Login</v-btn>
</form>
</v-card>
@ -52,7 +52,10 @@ export default {
AuthController.login(data).then(() => {
this.$router.push({ name: 'index' });
}).catch((error) => {
this.loginErrors.push(error.response.data);
const errors = error.response.data.non_field_errors;
for (let i = 0; i < errors.length; i++) {
this.loginErrors.push(errors[i]);
}
});
},
},