From a8883a6288c441f0b1ddedc5a964c9299f4f9a98 Mon Sep 17 00:00:00 2001 From: hburn7 Date: Tue, 26 Mar 2024 09:58:44 -0400 Subject: [PATCH] Rename roles to scopes --- app/actions.ts | 4 ++-- app/submit/page.tsx | 4 ++-- components/SubmitMatches/MatchForm/MatchForm.tsx | 4 ++-- lib/types.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/actions.ts b/app/actions.ts index f347464..ae536de 100644 --- a/app/actions.ts +++ b/app/actions.ts @@ -31,7 +31,7 @@ export async function getSession(onlyData: boolean = false) { osuPlayMode: session?.osuPlayMode, osuPlayModeSelected: session?.osuPlayModeSelected, username: session?.username, - roles: session?.roles, + scopes: session?.scopes, accessToken: session?.accessToken, }; @@ -81,7 +81,7 @@ export async function login(cookie: { session.osuPlayMode = loggedUser.osuPlayMode; session.osuPlayModeSelected = loggedUser.osuPlayMode; session.username = loggedUser.username; - session.roles = loggedUser.roles; + session.scopes = loggedUser.scopes; session.isLogged = true; await session.save(); diff --git a/app/submit/page.tsx b/app/submit/page.tsx index c7d988b..4604b00 100644 --- a/app/submit/page.tsx +++ b/app/submit/page.tsx @@ -10,12 +10,12 @@ export const metadata: Metadata = { }; export default async function page() { - const { roles } = await getSession(true); + const { scopes } = await getSession(true); return (
- +
); } diff --git a/components/SubmitMatches/MatchForm/MatchForm.tsx b/components/SubmitMatches/MatchForm/MatchForm.tsx index fad2cdf..bf5982f 100644 --- a/components/SubmitMatches/MatchForm/MatchForm.tsx +++ b/components/SubmitMatches/MatchForm/MatchForm.tsx @@ -23,7 +23,7 @@ function SubmitButton() { ); } -export default function MatchForm({ userRoles }: { userRoles: Array }) { +export default function MatchForm({ userScopes }: { userScopes: Array }) { const [state, formAction] = useFormState(saveTournamentMatches, initialState); const [rulesAccepted, setRulesAccepted] = useState(false); @@ -249,7 +249,7 @@ export default function MatchForm({ userRoles }: { userRoles: Array }) { matches can lead to a restriction - {(userRoles.includes('verifier')) && ( + {(userScopes.includes('verifier')) && (