Search code examples
javascripthttp-redirectoauth-2.0oauthauth0

javascript - oAuth: How to redirect user back to application?


I am new to javascript. I'm creating a login webpage with auth0, if the user enters the correct id/password the auth0 login API will redirect them back to the application, they are calling from based on their redirect URL.

I want to add a feature where if they don't accept terms and conditions, they would be redirected back to the application they are calling from via redirect URL.

Is it possible? I tried to search online but could not find any proper documentation. can anyone please advise?


Solution

  • I found the solution, I had to user callback URLs with the error message.

    Solution for this in Vue.js

    <a v-on:click="f1()">..</a>
    
     f1: function() {
           window.location.href = "myapp://callback?error=MyCustoomrErrorMessage";
        },