-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* auth/new: add to app router * auth/saml-idp: add to app router * fix
- Loading branch information
Showing
4 changed files
with
30 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { redirect } from "next/navigation"; | ||
|
||
export default function Page() { | ||
redirect(process.env.NEXT_PUBLIC_WEBAPP_URL || "https://app.cal.com"); | ||
} |
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 @@ | ||
export { default } from "~/auth/saml-idp/saml-idp-view"; |
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,23 @@ | ||
"use client"; | ||
|
||
import { signIn } from "next-auth/react"; | ||
import { useEffect } from "react"; | ||
|
||
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; | ||
|
||
// To handle the IdP initiated login flow callback | ||
export default function SamlIdp() { | ||
const searchParams = useCompatSearchParams(); | ||
|
||
useEffect(() => { | ||
const code = searchParams?.get("code"); | ||
|
||
signIn("saml-idp", { | ||
callbackUrl: "/", | ||
code, | ||
}); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return null; | ||
} |
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,21 +1 @@ | ||
import { signIn } from "next-auth/react"; | ||
import { useEffect } from "react"; | ||
|
||
import { useCompatSearchParams } from "@calcom/lib/hooks/useCompatSearchParams"; | ||
|
||
// To handle the IdP initiated login flow callback | ||
export default function Page() { | ||
const searchParams = useCompatSearchParams(); | ||
|
||
useEffect(() => { | ||
const code = searchParams?.get("code"); | ||
|
||
signIn("saml-idp", { | ||
callbackUrl: "/", | ||
code, | ||
}); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return null; | ||
} | ||
export { default } from "~/auth/saml-idp/saml-idp-view"; |