Skip to main content
Commonmark migration
Source Link
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

 

FacebookAuthCredential

 

GithubAuthCredential

 

GoogleAuthCredential

 

PhoneAuthCredential

 

PlayGamesAuthCredential

 

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

 

FacebookAuthCredential

 

GithubAuthCredential

 

GoogleAuthCredential

 

PhoneAuthCredential

 

PlayGamesAuthCredential

 

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

FacebookAuthCredential

GithubAuthCredential

GoogleAuthCredential

PhoneAuthCredential

PlayGamesAuthCredential

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
added 810 characters in body
Source Link
Sahil Manchanda
  • 10.6k
  • 4
  • 42
  • 94
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredentialEmailAuthCredential

FacebookAuthCredentialFacebookAuthCredential

GithubAuthCredentialGithubAuthCredential

GoogleAuthCredentialGoogleAuthCredential

PhoneAuthCredentialPhoneAuthCredential

PlayGamesAuthCredentialPlayGamesAuthCredential

TwitterAuthCredentialTwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

FacebookAuthCredential

GithubAuthCredential

GoogleAuthCredential

PhoneAuthCredential

PlayGamesAuthCredential

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

FacebookAuthCredential

GithubAuthCredential

GoogleAuthCredential

PhoneAuthCredential

PlayGamesAuthCredential

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass") 
Source Link
Sahil Manchanda
  • 10.6k
  • 4
  • 42
  • 94

let user = Auth.auth().currentUser var credential: AuthCredential user?.reauthenticateAndRetrieveData(with: credential, completion: {(authResult, error) in if let error = error { // An error happened. }else{ // User re-authenticated. } }) 

You are getting error because you haven't initialize credential You have to initialize AuthCredential first

These credential can vary from

EmailAuthCredential

FacebookAuthCredential

GithubAuthCredential

GoogleAuthCredential

PhoneAuthCredential

PlayGamesAuthCredential

TwitterAuthCredential

Initiziale the variable according to your authentication method e.g. if you have chosen email you can use like

var credential: AuthCredential = EmailAuthProvider.credential(withEmail: "email", password: "pass")