generated from acm-ucr/acm-ucr-website
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1870 from acm-ucr/sean/protectedpagesRSC
Protected Pages to RSC
- Loading branch information
Showing
5 changed files
with
61 additions
and
54 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
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,11 @@ | ||
"use client"; | ||
import { signIn } from "next-auth/react"; | ||
|
||
interface props { | ||
callback: string; | ||
} | ||
|
||
const SignIn = ({ callback }: props) => | ||
void signIn("google", { callbackUrl: callback }); | ||
|
||
export default SignIn; |
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,13 @@ | ||
import { NextResponse } from "next/server"; | ||
import type { NextRequest } from "next/server"; | ||
|
||
export function middleware(request: NextRequest) { | ||
const requestHeaders = new Headers(request.headers); | ||
requestHeaders.set("x-url", request.nextUrl.pathname); | ||
|
||
return NextResponse.next({ | ||
request: { | ||
headers: requestHeaders, | ||
}, | ||
}); | ||
} |