mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-04 20:26:17 +00:00
Feat: Org scoped JWT's CLI support
This commit is contained in:
@@ -5,7 +5,6 @@ import { useRouter } from "next/router";
|
|||||||
import { faGithub, faGitlab, faGoogle } from "@fortawesome/free-brands-svg-icons";
|
import { faGithub, faGitlab, faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||||
import { faLock } from "@fortawesome/free-solid-svg-icons";
|
import { faLock } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
import Error from "@app/components/basic/Error";
|
import Error from "@app/components/basic/Error";
|
||||||
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
|
||||||
@@ -57,17 +56,14 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
|
|||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// case: login was successful
|
|
||||||
const cliUrl = `http://127.0.0.1:${callbackPort}/`;
|
|
||||||
|
|
||||||
// send request to server endpoint
|
navigateUserToSelectOrg(router, callbackPort!);
|
||||||
const instance = axios.create();
|
} else {
|
||||||
await instance.post(cliUrl, { ...isCliLoginSuccessful.loginResponse });
|
setLoginError(true);
|
||||||
|
createNotification({
|
||||||
// cli page
|
text: "CLI login unsuccessful. Double-check your credentials and try again.",
|
||||||
router.push("/cli-redirect");
|
type: "error"
|
||||||
|
});
|
||||||
// on success, router.push to cli Login Successful page
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const isLoginSuccessful = await attemptLogin({
|
const isLoginSuccessful = await attemptLogin({
|
||||||
@@ -85,7 +81,7 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await navigateUserToSelectOrg(router);
|
navigateUserToSelectOrg(router);
|
||||||
|
|
||||||
// case: login does not require MFA step
|
// case: login does not require MFA step
|
||||||
createNotification({
|
createNotification({
|
||||||
|
|||||||
Reference in New Issue
Block a user