Skip to content

Hmt 99/login redirect #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app/participant/team-selection/CreateTeamPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ const CreateTeamPage = () => {
<li>
After forming a team, assign <b>ONE</b> member to{" "}
<b>&quot;Register New Team&quot;</b> using your Team Name.
They will receive a unique <b>6-digit Team ID</b>{" "}
They will receive a unique <b>4-digit Team ID</b>{" "}
following registration.
</li>
<li className={CREATE_TEAM_STEPS_STYLES}>
Next, provide this <b>6-digit Team ID</b> to all team
Next, provide this <b>4-digit Team ID</b> to all team
members.
</li>
<li className={CREATE_TEAM_STEPS_STYLES}>
Expand Down
12 changes: 12 additions & 0 deletions src/components/LoginForm/PersonalFormFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@ export default function PersonalFormFields({ user }: { user: AuthUser }) {
if (isError) {
return <div>Error, please try again later.</div>;
}
if (data?.teamId && data?.completedRegistration) {
if (data?.role === UserType.Admin) {
router.push("/admin");
return null;
} else if (data?.role === UserType.Judge) {
router.push("/judging");
return null;
} else {
router.push("/participant/profile");
return null;
}
}
if (data?.teamId) {
router.push(`/register/team/${data.teamId}`);
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/components/UserProfile/TeamProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ const TeamProfile = () => {
<li>
3. After forming a team , assign <strong>ONE</strong> member
to “Register New Team” using your Team Name. They will
receive a unique 6-digit Team ID following registration.
receive a unique 4-digit Team ID following registration.
</li>
<li>
4. Next, provide this 6-digit <strong>Team ID</strong> to
4. Next, provide this 4-digit <strong>Team ID</strong> to
all team members.
</li>
<li>
Expand Down
4 changes: 2 additions & 2 deletions src/components/teamRegistration/JoinTeamInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default function JoinTeamInstructions() {
<span className="font-bold"> ONE </span>
member to <span className="font-bold"> “Register New Team” </span>
using your Team Name. They will receive a unique
<span className="font-bold"> 6-digit Team ID </span>
<span className="font-bold"> 4-digit Team ID </span>
following registration.
</li>
<li>
Next, provide this
<span className="font-bold"> 6-digit Team ID </span>
<span className="font-bold"> 4-digit Team ID </span>
to all team members.
</li>
<li>
Expand Down
Loading