Skip to content

Instantly share code, notes, and snippets.

@zontan
Created September 23, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zontan/5b0ff9e3b3e442d06609bb3e2d0f26fd to your computer and use it in GitHub Desktop.
Save zontan/5b0ff9e3b3e442d06609bb3e2d0f26fd to your computer and use it in GitHub Desktop.
func authUI(_ authUI: FUIAuth, didSignInWith authDataResult: AuthDataResult?, error: Error?) {
if let error = error {
print(error.localizedDescription)
} else {
//Save the user to our list of users.
if let user = authDataResult?.user {
let ref = Database.database().reference()
ref.child("users").child(user.uid).setValue(["username" : user.displayName?.lowercased(),
"displayname" : user.displayName,
"email": user.email])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment