Commit ac7a13bc authored by jackie / Andrea Ida Malkah Klaura's avatar jackie / Andrea Ida Malkah Klaura
Browse files

FIX: token renewal, logger and self/this issue in App.vue

parent f32bef02
......@@ -88,12 +88,12 @@ export default {
oidc.Log.logger = console
let self = this
this.oidcmgr.events.addAccessTokenExpiring(function () {
this.$log.debug('starting silent access_token renewal')
console.log('Debug info: starting silent access_token renewal')
self.oidcmgr.signinSilent().then(function (user) {
self.user.access_token = user.access_token
this.$log.debug(self.user.access_token)
console.log(self.user.access_token)
}).catch(function (err) {
this.$log.debug(err)
console.log(err)
alert('Your OpenID access token could not be renewed automatically.\n' +
'You will be logged out in ' + process.env.VUE_APP_API_STEERING_OIDC_EXPIRE_NOTIFICATION + ' seconds.')
})
......@@ -111,20 +111,20 @@ export default {
},
methods: {
signIn () {
this.oidcmgr.signinRedirect().catch(function (err) {
this.oidcmgr.signinRedirect().catch(err => {
alert('Error: something went wrong when signing in. See console for details.')
this.$log.error(err)
})
},
signOut () {
let self = this
this.oidcmgr.signoutRedirect().then(function (resp) {
self.user.logged_in = false
this.oidcmgr.signoutRedirect().then(resp => {
this.user.logged_in = false
this.$log.debug('signed out', resp)
}).catch(function (err) {
}).catch(err => {
this.$log.error(err)
alert('Error: something went wrong when logging out. See console for details.')
})
console.log('3')
},
getSteeringUser () {
axios.get(process.env.VUE_APP_API_STEERING + 'users/', {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment