-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into DDFBRA-159-global-route-helper-function
- Loading branch information
Showing
39 changed files
with
813 additions
and
427 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Prettier check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# Make sure the actual branch is checked out when running on pull requests. | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 # 👈 Required to retrieve git history | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Check Prettier formatting | ||
run: yarn run format:check |
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 |
---|---|---|
|
@@ -43,3 +43,5 @@ next-env.d.ts | |
*storybook.log | ||
|
||
.env.local | ||
|
||
certificates |
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,3 @@ | ||
.next | ||
generated | ||
node_modules |
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 |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { z } from "zod"; | ||
import { z } from "zod" | ||
|
||
const schemas = { | ||
tokenSet: z.object({ | ||
access_token: z.string(), | ||
refresh_token: z.string(), | ||
id_token: z.string(), | ||
expires_in: z.number(), | ||
refresh_expires_in: z.number() | ||
refresh_expires_in: z.number(), | ||
}), | ||
introspect: z.object({ | ||
uniid: z.string(), | ||
institutionIds: z.string() | ||
institutionIds: z.string(), | ||
}), | ||
userInfo: z.object({ | ||
sub: z.string() | ||
}) | ||
}; | ||
sub: z.string(), | ||
}), | ||
} | ||
|
||
export default schemas; | ||
export default schemas |
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 |
---|---|---|
@@ -1,27 +1,24 @@ | ||
import { generators } from "openid-client"; | ||
import { generators } from "openid-client" | ||
|
||
import { | ||
getUniloginClient, | ||
uniloginClientConfig | ||
} from "@/lib/session/oauth/uniloginClient"; | ||
import { getSession } from "@/lib/session/session"; | ||
import { getUniloginClient, uniloginClientConfig } from "@/lib/session/oauth/uniloginClient" | ||
import { getSession } from "@/lib/session/session" | ||
|
||
export async function GET() { | ||
const session = await getSession(); | ||
const session = await getSession() | ||
|
||
session.code_verifier = generators.codeVerifier(); | ||
session.code_verifier = generators.codeVerifier() | ||
|
||
const code_challenge = generators.codeChallenge(session.code_verifier); | ||
const code_challenge = generators.codeChallenge(session.code_verifier) | ||
|
||
const client = await getUniloginClient(); | ||
const client = await getUniloginClient() | ||
const url = client.authorizationUrl({ | ||
scope: uniloginClientConfig.scope, | ||
audience: uniloginClientConfig.audience, | ||
redirect_uri: uniloginClientConfig.redirect_uri, | ||
code_challenge, | ||
code_challenge_method: "S256" | ||
}); | ||
code_challenge_method: "S256", | ||
}) | ||
|
||
await session.save(); | ||
return Response.redirect(url); | ||
await session.save() | ||
return Response.redirect(url) | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import { defaultSession, getSession } from "@/lib/session/session"; | ||
import { defaultSession, getSession } from "@/lib/session/session" | ||
|
||
export async function GET() { | ||
try { | ||
const session = await getSession(); | ||
const session = await getSession() | ||
if (!session) { | ||
return Response.json({ defaultSession }); | ||
return Response.json({ defaultSession }) | ||
} | ||
return Response.json({ | ||
isLoggedIn: session.isLoggedIn, | ||
userInfo: session.userInfo | ||
}); | ||
userInfo: session.userInfo, | ||
}) | ||
} catch (e) { | ||
return Response.json({ error: e }, { status: 500 }); | ||
return Response.json({ error: e }, { status: 500 }) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import Image from "next/image"; | ||
import Image from "next/image" | ||
|
||
export default async function Home() { | ||
return ( | ||
|
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
Oops, something went wrong.