Skip to content

[RSO] set access-control-allow-origin res header - #396

Open
luoh00 wants to merge 13 commits into
mainfrom
haoking/test
Open

[RSO] set access-control-allow-origin res header#396
luoh00 wants to merge 13 commits into
mainfrom
haoking/test

Conversation

@luoh00

@luoh00 luoh00 commented Nov 12, 2024

Copy link
Copy Markdown
Collaborator

hopefully this fixes prod

Created /rso/oauth in auth.js which takes in access code in its URL as a query string and exchanges this code for tokens using fetch to Riot's /token endpoint.

Verified this worked using Postman.
Added button inside Header.tsx that redirects user
to /rso/signin endpoint. Modified /rso/signin to
redirect to link instead of returning a Sign In
button that would redirect to Riot sign in page.
Created an endpoint in auth.js that will fetch a GET to Riot's
/account endpoint to know who logged in using RSO and get the
player's userid, player tag, and player name.
Finished /rso/getUserInfo route so that it takes an access token in
the params and fetches to Riot's /accounts/v1/me endpoint to get
player username, tagline, and uuid. Added functionality to Header.tsx
to show the user's username and tagline if they logged in via RSO.
Added null checks to leaderboard.tsx component and leaderboard endpoint.
Added a header to the response of /rso/oauth to hopefully solve problem
on prod where fetch to /rso/oauth with the code times out.
@Kagiri2 Kagiri2 closed this Nov 15, 2024
@Kagiri2 Kagiri2 reopened this Nov 15, 2024
Added Riot puuid, IGN, tagline, RSO access and refresh tokens to the
top level AuthContext in App.tsx. Relocated fetch to /rso/getUserInfo
endpoint to App.tsx's useEffect instead of leaving it in Header.tsx
since otherwise Header.tsx would continuously refetch to get user info.
Added a RiotProfile.tsx component and began creating a skeleton for it.
In the future this can be used to display Valorant stats that signed in
with RSO similar to tracker.gg.
Created new endpoint getPuuid to get the correct puuid for a Riot
account. This is needed because when using the puuid returned from the
getUserInfo endpoint for any Riot API that uses the puuid as part of the
url param, response returns an error saying couldn't decrypt the puuid.
The new endpoint getPuuid should fix this by returning a usable puuid.
@luoh00
luoh00 force-pushed the haoking/test branch 2 times, most recently from 5f6ffba to ca16270 Compare December 6, 2024 19:37
Began implementation of how to fetch to Riot endpoint to retrieve array
of recent match ids of a player that logged in via RSO.
src/web/src/App.tsx
src/web/src/Components/global/Header.tsx
src/web/src/Pages/user/RiotProfile.tsx
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions Bot added the Stale label Jan 21, 2025
@shimupan shimupan removed the Stale label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants