I am using firebase client sdk to login with signInWithEmailAndPassword method on my server now I also want to unauth/logout user from the server (admin sdk) code. I tried following code but the old token is still working. What can we do? does the custom token will work in this case ? Basically I want to manage user login and logout on my server rather depend on firebase client sdk
FirebaseAdmin.auth().revokeRefreshTokens(uid)
.then(() => {
return FirebaseAdmin.auth().getUser(uid);
})
.then((userRecord) => {
return new Date(userRecord.tokensValidAfterTime).getTime() / 1000;
})
.then((timestamp) => {
//return valid response to ios app to continue the user's login process
});