Skip to content

Commit

Permalink
update typo for google
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jun 23, 2024
1 parent 802ee1c commit c711ac1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/backend/app/users/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Token(BaseModel):


class Auth:
"""Main class for OSM login."""
"""Main class for Google login."""

def __init__(
self,
Expand All @@ -46,9 +46,9 @@ def __init__(
)

def login(self) -> dict:
"""Generate login URL from OSM session.
"""Generate login URL from Google session.
Provides a login URL using the session created by osm
Provides a login URL using the session created by Google
client id and redirect uri supplied.
Returns:
Expand All @@ -58,7 +58,7 @@ def login(self) -> dict:
return json.loads(Login(login_url=login_url).model_dump_json())

def callback(self, callback_url: str) -> str:
"""Performs token exchange between OSM and the callback website.
"""Performs token exchange between Google and the callback website.
Core will use Oauth secret key from configuration while deserializing token,
provides access token that can be used for authorized endpoints.
Expand All @@ -79,7 +79,7 @@ def callback(self, callback_url: str) -> str:
user_api_url = "https://www.googleapis.com/oauth2/v1/userinfo"
resp = self.oauth.get(user_api_url)
if resp.status_code != 200:
raise ValueError("Invalid response from OSM")
raise ValueError("Invalid response from Google")
data = resp.json().get("user")
serializer = URLSafeSerializer(self.secret_key)
user_data = {
Expand All @@ -102,7 +102,7 @@ def deserialize_access_token(self, access_token: str) -> dict:
access_token(str): The access token from Auth.callback()
Returns:
user_data(dict): A JSON of user data from OSM.
user_data(dict): A JSON of user data from Google.
"""
deserializer = URLSafeSerializer(self.secret_key)

Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/users/user_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class AuthUser(BaseModel):
"""The user model returned from OSM OAuth2."""
"""The user model returned from Google OAuth2."""

id: int
email: EmailStr
Expand Down

0 comments on commit c711ac1

Please sign in to comment.