Skip to content

Commit

Permalink
Merge pull request #139 from UoaWDCC/VOL-138/Enum-Context
Browse files Browse the repository at this point in the history
Enums, and dir structure, template code
  • Loading branch information
John-Moore-UOA authored Jul 9, 2024
2 parents f1ec173 + aef4248 commit f340515
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { handleGoogle } from "../../services/firebase.tsx";
import { handleGoogle } from "../firebase/firebase.tsx";

function Header() {
return (
Expand Down
5 changes: 5 additions & 0 deletions web/src/context/AuthenticationContext.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import React from "react";

const AuthenticationContext = React.createContext(null);

export default AuthenticationContext;
Empty file.
6 changes: 6 additions & 0 deletions web/src/enums/route.access.level.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const AccessLevel = {
USER: "user",
STAFF: "staff",
};

export default AccessLevel;
4 changes: 4 additions & 0 deletions web/src/firebase/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Set up staff protected routes #129
// https://github.com/orgs/UoaWDCC/projects/33?pane=issue&itemId=69456673


20 changes: 20 additions & 0 deletions web/src/firebase/StaffAuth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Complete in Issue

import { useState } from "react";

function StaffAuth() {

const [isStaff, setAsStaff] = useState(false);

function checkIfStaff(email: string) {
const splitEmail = email.split("@");
const emailDomain = splitEmail[1];

return emailDomain === "auckland.ac.nz"; // Add check for specific volunteering admin email
}


return isStaff;
}

export default StaffAuth;
File renamed without changes.

0 comments on commit f340515

Please sign in to comment.