mvertopoulos / vue-msal

Vue plugin for using Microsoft Authentication Library (MSAL)
MIT License
123 stars 66 forks source link

callback after refreshing expired access token? #8

Closed mihaiserban closed 4 years ago

mihaiserban commented 4 years ago

I need to set the access token on axios instance, and i'm doing this onAuthentication. However I can't find a callback when the accessToken is refreshed.

on app mount/create, $msal.data.accessToken is empty.

mvertopoulos commented 4 years ago

I need to set the access token on axios instance, and i'm doing this onAuthentication. However I can't find a callback when the accessToken is refreshed.

There is an onToken callback in auth options, have you tried it?

on app mount/create, $msal.data.accessToken is empty.

Please take a look at this answer to a previous issue

Let me know if that helps.

mihaiserban commented 4 years ago

@mvertopoulos the answer did the trick. used the watch feature to check for accessToken changes.

I didn't manage to use onToken, it didn't seem to get called.

mvertopoulos commented 4 years ago

I didn't manage to use onToken, it didn't seem to get called.

I will check the onToken issue.