Skip to content

Instantly share code, notes, and snippets.

@zontan
Created July 6, 2020 17:28
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/322020d1fc5afa946f5fbb65bae9137b to your computer and use it in GitHub Desktop.
Save zontan/322020d1fc5afa946f5fbb65bae9137b 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