Closed mirkods closed 8 years ago
Solved with version 2.0.3!
I could not get it to work. The user is still redirected to
http[s]://customdomain.com/auth/v1/logout
.
Let me know if I need to do something else.
@samarthagarwal Do you want an asyncronous logout ?
That would be good. But as of now I don't have a route at /auth/v1/logout
in my application. So as soon as I (or a user) tries to logout, they get a 404. What are the possible solutions?
PS: It would be great if we could provide a url to redirect to after logout.
Inizialize the sdk with absoluteUrl option:
Stamplay.init('APPID', { absoluteUrl: true })
I just tried that. Still the same problem.
Which version of the sdk are you using ?
The latest one, 2.0.3. I just updated.
Mmmh it's so strange! Can you give me more information about it?
This is the line of code that manage the redirection https://github.com/Stamplay/stamplay-js-sdk/blob/master/src/user.js#L79
Can you give me a code example of how to call the logout
method asynchronously? I think that something is causing async
to be false
.
Stamplay.User.logout(true, [callback])
Yes, I am doing the same. I see an error in GET request for /auth/v1/logout and then an immediate redirect to my homepage happens. Half a second later I see this.
What kind of error ? If you want you can write to me in the Stamplay Slack community or via email
Update: I removed everything from the callback and just placed a console.log("From Logout Callback")
. Here is the error screenshot.
Kind of working fine for me now. Just getting the error above. Thanks.
Is not an issue on the sdk, please add the custom domain in the cors on editor.stamplay.com
The error shows the URL from the Stamplay, not my custom domain. Also the custom domain is already added.
If there is an app that use Stamplay only as backend without the hosting the logout method redirect the user on a link with this format:
http[s]://customdomain.com/auth/v1/logout
In this case because the host is not provided by Stamplay this means that this endpoint should be implemented on the customer's webserver.