Browse Source

Login fix

master
Joshua Rubingh 8 months ago
parent
commit
748ca548cf
  1. 16
      pages/login.vue

16
pages/login.vue

@ -1,21 +1,17 @@ @@ -1,21 +1,17 @@
<template>
<div></div>
<div></div>
</template>
<script>
export default {
layout: 'landing',
mounted() {
this.$auth.loginWith('cookie')
.then(() => {
console.log('cookie', arguments);
this.$auth.fetchUser().then((response) => {
this.$auth.setUser(response.data);
});
this.$axios.get('/api/v1/researchers/me/').then((response) => {
this.$auth.setUser(response.data)
this.$auth.loginWith('cookie').catch(() => {
window.location.href = `https://api-vre.web.rug.nl/auth/login/?next=${location.origin}${this.$auth.$state.redirect}`
})
.catch(() => {
window.location.href = `https://api-vre.web.rug.nl/auth/login/?next=${location.origin}${this.$auth.$state.redirect}`;
});
})
// this.$auth.login({
// data: {

Loading…
Cancel
Save