Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhilS2 committed May 11, 2024
1 parent 189f9fb commit a0b7818
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/loginPage/page.tsx
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ const LoginComponent = () => {
}, []);

/*const handleLoginSuccess = async (tokenResponse: any) => {
if ('code' in tokenResponse) {
if ('code' in tokenResponse) {
// Handle authorization code flow
console.log('Authorization Code:', tokenResponse.code);
// Exchange code for tokens here
@@ -71,7 +71,7 @@ const LoginComponent = () => {
//client side authentication retrieve user info from access token
const userInfo = await axios
.get('https://www.googleapis.com/oauth2/v3/userinfo', {
headers: { Authorization: `Bearer ${tokenResponse.}` },
headers: { Authorization: `Bearer ${tokenResponse.access_token}` },
})

.then(res => res.data);
3 changes: 1 addition & 2 deletions backend/myapi/views.py
Original file line number Diff line number Diff line change
@@ -86,8 +86,7 @@ def validate_user(request):



#using access token we can get the user information

#using access token to retrieve user information similar to frontend
try:
response = requests.get(
GOOGLE_USER_INFO_URL,

0 comments on commit a0b7818

Please sign in to comment.