-
Notifications
You must be signed in to change notification settings - Fork 9
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
Api overhaul #87
Merged
Merged
Api overhaul #87
Changes from 60 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
1948d7a
Replace "Profile" with first section of user name
yrjarv 9cfb39e
Allow width of LoginButton to be automatic
yrjarv 3ac806f
Enable shortening of first name in profile button
yrjarv 9056baf
Added force-graph logic
EricSvebakk 4e18084
Reduce max first name length in profile button to 15
yrjarv 216dbd2
Reload page when user info is updated
yrjarv 0b9a317
Replace hyphens in first name with non-breaking hyphen
yrjarv cee4b41
Merge pull request #44 from yrjarv/main
EricSvebakk 99e5190
Manually replaces "About CYB" with "About" on mobile
yrjarv 2c516d4
Audited mui version
EricSvebakk 15dc90b
Update development.yml
EricSvebakk 0972970
Merge branch 'feature-recruitment-graph' into development
EricSvebakk eb8b2f2
Merge branch 'development'
EricSvebakk 4f7d813
Merge pull request #58 from yrjarv/shorter-about-mobile
EricSvebakk 4dfd6f8
Merge branch 'development'
EricSvebakk bcbc8d1
Squashed commit adding pr/53
EricSvebakk 420e092
Squashed commit adding pr/67:
EricSvebakk 3a2cabc
Squashed commit adding pr/75
EricSvebakk ebe4c43
Squashed commit adding pr/64
EricSvebakk 184fe7d
Squashed commit adding pr/82
EricSvebakk 9440123
updated api to include api version in path
Sebbben fad4284
updated all links to use new api path
Sebbben c77a94a
beginning of api rewrite
Sebbben 9e9ae13
logs
Sebbben fa72104
admin page converted to new api
Sebbben ab2adb6
middleware proof of concept
Sebbben 123b657
further middleware implementation
Sebbben 9745bd6
turned off middleware after realising it wont work for auth
Sebbben 5a899b8
more REST api implementation
Sebbben 2de5d3e
board page
Sebbben 5612c7f
profile page
Sebbben d7a4473
volunteering page
Sebbben d8dbc35
fixed typo
Sebbben 025025a
log and cafe pages
Sebbben 535d39d
fixed stuff that broke with shift scheduler
Sebbben 77b9ad2
patch request for profile page
Sebbben 467ad3d
voucher and work logs posts
Sebbben 2edd695
user to workgroup post
Sebbben 9ca89f6
Add members
Sebbben ef572bb
Register user
Sebbben 738ce30
cafe shift post
Sebbben 5a0b333
admin setroles post
Sebbben 5340df0
api rework complete, but potentialy contain bugs
Sebbben d96a721
bug fixes
Sebbben ba102fa
first auth attempt
Sebbben e80c943
second auth attempt and beginning of securing api
Sebbben c36efde
added x-auth-verified custom header to api responses that has been ve…
Sebbben b483e92
added custom header to api error responses
Sebbben 5201382
role based and param based auth added to all api endpoints
Sebbben e40ccd6
workaround for chaining with async functions not working properly
Sebbben 22a378d
fixed roles not showing on profile page
Sebbben 35962f6
fixed some roles but that was introduced with slimming of session object
Sebbben eabcbd6
fix for half-chaining requirements
Sebbben f466be2
swithced back to chaining syntax, but made entire auth class non-async
Sebbben b59a8eb
replaced relative imports of authOptions for absolute import
Sebbben 2384869
added ownership requirement to updating user userinfo
Sebbben edd075d
fixed edgecase in require ownership if session is null
Sebbben af8200f
admin buypass on ownership requirements
Sebbben 83f5056
Auth util documentation updated
Sebbben 81e8920
updated access to semester and semesterVolunteerInfo endpoints to not…
Sebbben f02aa36
fixed issues pointed out by pvk05's review
Sebbben 22335f0
removed last middleware file
Sebbben 6861a17
merged dev into featureBranch for fast forward merge when integrating…
Sebbben 9546e15
fixed unmerged conflicts and removed middleware.js
Sebbben b71fa04
changed api auth to only require one of the given roles to get access…
Sebbben c53b2ed
fixed issue with switch case missing breaks so all requests returned …
Sebbben c1e1300
fixed problems with setting roles
Sebbben b6209d7
fixed issues with headers in customtabes on admin page
Sebbben dc4e9fd
changed default filter on logs table on admin page
Sebbben 23799d5
removed intern role for accessing endoints
Sebbben 2009232
fixed board page to not include orphans
Sebbben File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ DATABASE_SCHEMA = 'ISV2_development' | |
DATABASE_URL = "mysql://${DATABASE_USER}:${DATABASE_PASS}@localhost:3307/${DATABASE_SCHEMA}" | ||
|
||
NEXTAUTH_URL = 'http://localhost:3005' | ||
NEXTAUTH_CALLBACK = '/pages/main/home' | ||
NEXTAUTH_CALLBACK = '/' | ||
NEXTAUTH_SECRET = 'QuTxFdD3yon9X+83rRaio/vSgkfhvnwUglcIrnUwTLA=' | ||
|
||
NODEMAILER_NOREPLY_USER = '[email protected]' | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { NextResponse } from "next/server"; | ||
|
||
export async function middleware(req) { | ||
return NextResponse.next() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
"use client" | ||
|
||
import { PageHeader } from "@/app/components/sanity/PageBuilder"; | ||
import { Box } from "@mui/material"; | ||
import { useEffect, useState } from "react"; | ||
import Forcegraph from "@/app/components/RecruitmentGraph" | ||
|
||
export default function BoardPage() { | ||
|
||
const [data, setData] = useState({ nodes: [], edges: [] }); | ||
|
||
useEffect(() => { | ||
fetch(`/api/v2/recruitGraph`) | ||
.then(res => res.json()) | ||
.then(data => { | ||
setData({ nodes: data.nodes, edges: data.edges}) | ||
}) | ||
|
||
}, []); | ||
|
||
return ( | ||
<Box> | ||
<PageHeader text="Board tools" /> | ||
|
||
<Forcegraph data={data}/> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,14 @@ import { | |
ThemeProvider, | ||
Paper, | ||
} from "@mui/material"; | ||
import { SessionProvider } from "next-auth/react"; | ||
import { SessionProvider, useSession } from "next-auth/react"; | ||
import { usePathname } from "next/navigation"; | ||
import { NavBar } from "@/app/components/layout/AppBar"; | ||
import { cybTheme } from "@/app/components/themeCYB"; | ||
import LayoutFooter from "@/app/components/layout/Footer"; | ||
|
||
const NavItems = [ | ||
{ id: "home", path: "home", name: "Home", icon: <Home /> }, | ||
{ id: "home", path: "", name: "Home", icon: <Home /> }, | ||
{ id: "aboutCYB", path: "aboutCYB", name: "About CYB", icon: <Groups /> }, | ||
{ | ||
id: "volunteering", | ||
|
@@ -28,7 +28,7 @@ const NavItems = [ | |
}, | ||
]; | ||
|
||
export default function AppLayout({ children }) { | ||
export default async function AppLayout({ children }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove async from client component |
||
|
||
const pathname = usePathname(); | ||
|
||
|
@@ -61,7 +61,10 @@ export default function AppLayout({ children }) { | |
}} | ||
> | ||
<Container sx={{ mb: 3 }}> | ||
<SessionProvider>{children}</SessionProvider> | ||
<SessionProvider | ||
basePath="/api/v2/auth" | ||
refetchOnWindowFocus={false} | ||
>{children}</SessionProvider> | ||
</Container> | ||
</Container> | ||
</Box> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove unused middleware function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { NextResponse } from "next/server"; | ||
|
||
export function middleware(req) { | ||
console.log("Main middleware") | ||
return NextResponse.next() | ||
} |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused function