Hi team, I have used Descope flows with everythin...
# ask-a-descoper
b
Hi team, I have used Descope flows with everything to default, only changing whitelisted URL to http://localhost:3000 and redirect URL in auth flows to http://localhost:3000/login. But no matter what I have tried, I always get this error:
Copy code
{
  "code": "E061003",
  "description": "Redirect URL does not matched approved domain list",
  "message": "<http://localhost:3000/login?descope-login-flow=sign-up-or-in%7C%23%7C2Q4HaKbfsd7surPvxYa1YGpsiOe_4.end>"
}
s
what value do you have here ?
message has been deleted
b
s
change plz to
localhost
or keep empty
1
b
@square-vr-55083 yeah, removing it worked. But now after coming back to the app it says:
Refreshing the page during a flow is not supported yet
s
try with incognito plz
also can you post here the code snippet you are using ?
b
let me try
I am just using this in a NuxtJS (Vue) app:
Copy code
<descope-wc project-id="P2PPnGdNY5cDlZqi9EWKZmdbBL6e" flow-id="sign-up-or-in" debug="true"></descope-wc>
page is at
/login
route
s
Looping in @few-holiday-24516 , we are planning to release soon a Vue SDK, so it might be easier to use that
b
ok. though I think this problem is quite basic and we are probably missing a minute detail
because this worked if I placed the snippet on home page
but very surprisingly, it also only worked 1 time. after that it never worked and keeps giving me same error as above
s
Let me check, few stuff, looping in also @great-diamond-35515 in case he saw similar error
did you init the SDK script ? like this ?
Copy code
<head>
  <script src="<https://unpkg.com/@descope/web-component@latest/dist/index.js>"></script>
  <script src="<https://unpkg.com/@descope/web-js-sdk@latest/dist/index.umd.js>"></script>
</head>
b
yes. So I think I can consistently reproduce it. 1. I deleted my user that was created by signup 2. Tried login with Google again 3. It asked for phone number verification etc. So SDK works fine till here even after auth 4. On clicking “Finish” after completing verification, it does not move anywhere 5. I can see access token in local storage with Descope user id embedded in token 6. Trying to login again will result in failure with above message.
Refreshing the page during a flow is not supported yet
@square-vr-55083FYI. Might help in resolving the issue
stuck here
s
did you want to do 2 factor in your login ?
also, try to clear cookies and local storage, does it solve it ?
f
@brash-pencil-33614 once the flow is finished a
success
event is dispatched with the session & refresh tokens, You should listen to this event, and navigate the user to the desired page on you app
For example:
Copy code
const descopeWcEle = document.querySelector('descope-wc');
       descopeWcEle.addEventListener('success', (event) =>{
        console.log('Success!', event) //event will contain the JWTs
        window.location.assign('/home');
      }
g
reg the
Refreshing the page during a flow is not supported yet
console error, the sdk should not print it, we are working on fixing it, but in the meantime - you can simply ignore this error
s
@brash-pencil-33614 did you manage?
b
@square-vr-55083 yeah
managed to complete the entire flow
will publish a NuxtJS example integration with Descope
birthday party parrot 3
🚀 4
s
👍