I’m trying to log out of google with expo authsession, but it always returns the error message: Failed to revoke token: RevokeTokenRequest requires a valid token to revoke . I’ve already tried to put Bearer ${google_access_token} and ${google_access_token} but without success.
//LOGOUT GOOGLE
const handleLogoutGoogle = async () => {
let config = {
issuer: "https://accounts.google.com/o/oauth2/v2/logout",
scopes: ["openid", "profile"],
/* This is the CLIENT_ID generated from a Firebase project */
clientId: "cccccccccc-aio1fviva82o78umts2k4uvsn1val515.apps.googleusercontent.com",
};
const google_access_token = await AsyncStorage.getItem("@myApp:googleAccessToken");
if (google_access_token) {
console.log(`Bearer ${google_access_token}`);
try {
await AuthSession.revokeAsync(config, {
token: `${google_access_token}`,
isClientIdProvided: true,
});
await AsyncStorage.removeItem("@myApp:googleAccessToken");
return null;
} catch (e) {
console.log(`Failed to revoke token: ${e.message}`);
}
}
};
//LOGOUT GOOGLE