Reputation: 181
How can I restore a sessionid in Firebase auth?
public async saveSessionId() {
return auth().currentUser?.getIdToken().then((id) => {
this.sessionId = id;
AsyncStorage.setItem('@tokenid', this.sessionId);
});
}
public async signInWithSessionId() {
const credential = firebase.auth.???.credential(this.sessionId);
return auth().signInWithCredential(credential);
}
Is there any provider or any method for reload session after reload the program?
Upvotes: 0
Views: 130
Reputation: 251
Maybe this one method will help you to reload the session.
public async signInWithSessionId() {
const credential = firebase.auth().signInWithCustomToken(this.sessionId);
return credential.user;
}
Upvotes: 1