File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66
77import { Button , Flex } from "@radix-ui/themes" ;
88import { useAuth } from "@workos-inc/authkit-nextjs/components" ;
9- import { useEffect , useState } from "react" ;
10- import { getSignInUrlAction } from "../actions/getSignInUrl" ;
119import { handleSignOutAction } from "../actions/signOut" ;
1210
1311export function SignInButton ( { large } : { large ?: boolean } ) {
1412 const { user, loading } = useAuth ( ) ;
15- const [ signInUrl , setSignInUrl ] = useState < string | undefined > ( undefined ) ;
16-
17- useEffect ( ( ) => {
18- getSignInUrlAction ( ) . then ( setSignInUrl ) ;
19- } , [ ] ) ;
2013
2114 if ( loading ) {
2215 return < div > Loading...</ div > ;
@@ -36,7 +29,7 @@ export function SignInButton({ large }: { large?: boolean }) {
3629
3730 return (
3831 < Button asChild size = { large ? "3" : "2" } >
39- < a href = { signInUrl } > Sign In { large && "with AuthKit" } </ a >
32+ < a href = "/login" > Sign In { large && "with AuthKit" } </ a >
4033 </ Button >
4134 ) ;
4235}
Original file line number Diff line number Diff line change 1+ import { getSignInUrl } from "@workos-inc/authkit-nextjs" ;
2+ import { redirect } from "next/navigation" ;
3+
4+ export const GET = async ( ) => {
5+ const signInUrl = await getSignInUrl ( ) ;
6+
7+ return redirect ( signInUrl ) ;
8+ } ;
You can’t perform that action at this time.
0 commit comments