Auth0 Home Blog Docs

ClearSession not returning promise unless cancelled

I am using react native and copied the example login and logout. I can login successfully and get a token just fine. When I try to logout I am calling auth0.webAuth.clearSession() and I do get a promise back however I do not get a success from the promise. The ClearSession function calls a show method for the logout URL(https://connectedreasoning.auth0.com/v2/logout). The application screen shows the word “OK”. This is the html that is rendered from the logout URL. What I expected to get was a success response to the promise. Am I supposed to configure the logout endpoint to return the successful response to my promise?

Consequently The application is stuck at the ok screen with a cancel button available. If I click cancel the promise returns an error. Otherwise it seems stuck
How should I handle this?

I went from this
if (Platform.OS === ‘android’) {
this.setState({ accessToken: null });
} else {
auth0.webAuth
.clearSession({})
.then(success => {
this.setState({ accessToken: null });
})
.catch(error => console.log(error));
}

to this

this.setState({ accessToken: null });
auth0 = new Auth0(credentials);

is my problem solved? because it sure feels like my problem is solved.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.