-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,185 additions
and
1,423 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,8 @@ | ||
"use client"; | ||
import Skeleton from "@/components/Skeleton"; | ||
import { userManager } from "@/lib/auth"; | ||
import { useEffect } from "react"; | ||
import { AuthProvider, AuthProviderProps, useAuth } from "react-oidc-context"; | ||
import { permanentRedirect } from "next/navigation"; | ||
|
||
const config = { | ||
userManager, | ||
onSigninCallback: (user) => { | ||
console.log(user); | ||
permanentRedirect("/review"); | ||
}, | ||
} satisfies AuthProviderProps; | ||
|
||
export default function AuthLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return <AuthProvider {...config}>{children}</AuthProvider>; | ||
return children; | ||
} |
23 changes: 4 additions & 19 deletions
23
frontend/review-nextjs/app/(header)/(auth)/review/page.tsx
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,35 +1,20 @@ | ||
"use client"; | ||
import Skeleton from "@/components/Skeleton"; | ||
import { cn } from "@/lib/utils"; | ||
import { useEffect } from "react"; | ||
import { useAuth } from "react-oidc-context"; | ||
|
||
/* | ||
On error with fetching data | ||
try { | ||
userManager.signinSilent() | ||
} catch (error) { | ||
userManager.signinRedirect() | ||
} | ||
*/ | ||
|
||
export default function Review() { | ||
const auth = useAuth(); | ||
|
||
return ( | ||
<div id="review" className={cn("mx-[20%]")}> | ||
{auth.isLoading ? <Skeleton /> : <ReviewPage />} | ||
{/* {auth.isLoading ? <Skeleton /> : <ReviewPage />} */} | ||
</div> | ||
); | ||
} | ||
|
||
function ReviewPage() { | ||
const auth = useAuth(); | ||
|
||
return ( | ||
<p> | ||
Secret data that needs authentication {auth.isAuthenticated}{" "} | ||
{auth.user?.profile.email} | ||
Secret data | ||
{/* Secret data that needs authentication {auth.isAuthenticated}{" "} */} | ||
{/* {auth.user?.profile.email} */} | ||
</p> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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,8 +1,8 @@ | ||
/** @type {import('postcss-load-config').Config} */ | ||
const config = { | ||
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
plugins: { | ||
"@tailwindcss/postcss": {}, | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.