The Lazy Developer's Guide to Authentication with Vue.js

Paul Simon

Hi Matt, Thanks for your reply but I already had that in place, so I am not sure what the problem was…However, with some help from OKTA Support I went about it a different way. I left the standard approach from the intro to Vue on OKTA in place, and just took a copy of the implicitcallback.vue file from the node_modules, Copied it to my src folder renamed it and then amended it to carry out the extra operation that I needed after a successful login,


export default
{
name: ‘OKTAPostLogin’,
async beforeMount ()
{
await this.$auth.handleAuthentication()
// Start of our code
this.OurRoutine()
// End of our code
this.$router.replace(
{
path: this.$auth.getFromUri()
}
)
},
render()
{
},

So effective we put out code to get information on the user from the database, after the handleAuthentication has confirmed that the user has logged in successfully and has stored the tokens, and before OKTA redirects back to the original route that the user was trying to access before OKTA popped up the login challenge.

Regards

Paul Simon