Skip to content

Commit

Permalink
show ticket route to guest
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed May 15, 2024
1 parent 6899cdb commit 098946a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/providers/auth.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ import type { User, AuthProvider as FirebaseAuthProvider } from "firebase/auth";
import type { NotificationOptions } from "@/providers/types";
import type { ApplicationData } from "@/components/forms/types";

type UserType = "hacker" | "mentor" | "volunteer" | "speaker" | "sponsor";
type UserType =
| "hacker"
| "mentor"
| "volunteer"
| "speaker"
| "sponsor"
| "guest";

export interface UserWithClaims extends User {
hawkAdmin: boolean;
Expand Down
6 changes: 6 additions & 0 deletions src/providers/routes.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ export const RoutesProvider: FC<ComponentProps> = ({ children }) => {
];
}

if (currentUser.type === "guest") {
userRoutes.children = [
{ index: true, path: paths.myTicket, element: <TicketPage /> },
];
}

// only default routes
setUserRoutes(userRoutes.children);
setRoutes(availableRoutes);
Expand Down

0 comments on commit 098946a

Please sign in to comment.