mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-02 16:25:52 +00:00
Fix: SAML CLI login
This commit is contained in:
@@ -54,20 +54,25 @@ export default function LoginPage() {
|
|||||||
|
|
||||||
const handleSelectOrganization = useCallback(
|
const handleSelectOrganization = useCallback(
|
||||||
async (organization: Organization) => {
|
async (organization: Organization) => {
|
||||||
|
const callbackPort = queryParams.get("callback_port");
|
||||||
|
|
||||||
if (organization.authEnforced) {
|
if (organization.authEnforced) {
|
||||||
// org has an org-level auth method enabled (e.g. SAML)
|
// org has an org-level auth method enabled (e.g. SAML)
|
||||||
// -> logout + redirect to SAML SSO
|
// -> logout + redirect to SAML SSO
|
||||||
|
let samlUrl = `/api/v1/sso/redirect/saml2/organizations/${organization.slug}`;
|
||||||
|
|
||||||
|
if (callbackPort) {
|
||||||
|
samlUrl += `?callback_port=${callbackPort}`;
|
||||||
|
}
|
||||||
|
|
||||||
await logout.mutateAsync();
|
await logout.mutateAsync();
|
||||||
window.open(`/api/v1/sso/redirect/saml2/organizations/${organization.slug}`);
|
window.open(samlUrl);
|
||||||
window.close();
|
window.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { token } = await selectOrg.mutateAsync({ organizationId: organization.id });
|
const { token } = await selectOrg.mutateAsync({ organizationId: organization.id });
|
||||||
|
|
||||||
const callbackPort = queryParams.get("callback_port");
|
|
||||||
|
|
||||||
if (callbackPort) {
|
if (callbackPort) {
|
||||||
const privateKey = localStorage.getItem("PRIVATE_KEY");
|
const privateKey = localStorage.getItem("PRIVATE_KEY");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user