Skip to content

Commit

Permalink
fixed auth update profile link + added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
el-vishal committed Feb 19, 2022
1 parent 300965f commit d3f1d86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ user = auth.sign_in_with_email_and_password(email, password)
# Log the user in anonymously
user = auth.sign_in_anonymous()

# Add user info
user = auth.update_profile(display_name, photo_url, delete_attribute)

# Get user info
user = auth.get_account_info()

# Get a reference to the database service
db = firebase.database()

Expand Down
2 changes: 1 addition & 1 deletion pyrebase/pyrebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def update_profile(self, id_token, display_name = None, photo_url = None, delete
"""
https://firebase.google.com/docs/reference/rest/auth#section-update-profile
"""
request_ref = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/updateAccount?key={0}".format(self.api_key)
request_ref = "https://identitytoolkit.googleapis.com/v1/accounts:update?key={0}".format(self.api_key)
headers = {"content-type": "application/json; charset=UTF-8"}
data = json.dumps({"idToken": id_token, "displayName": display_name, "photoURL": photo_url, "deleteAttribute": delete_attribute, "returnSecureToken": True})
request_object = requests.post(request_ref, headers=headers, data=data)
Expand Down

0 comments on commit d3f1d86

Please sign in to comment.