mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 21:28:18 +00:00
Correct SSO linking case and uncomment audit logs v2
This commit is contained in:
@@ -57,7 +57,6 @@ export const login1 = async (req: Request, res: Response) => {
|
|||||||
if (!user.authMethods.includes(AuthMethod.EMAIL)) {
|
if (!user.authMethods.includes(AuthMethod.EMAIL)) {
|
||||||
await validateProviderAuthToken({
|
await validateProviderAuthToken({
|
||||||
email,
|
email,
|
||||||
user,
|
|
||||||
providerAuthToken,
|
providerAuthToken,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -109,7 +108,6 @@ export const login2 = async (req: Request, res: Response) => {
|
|||||||
if (!user.authMethods.includes(AuthMethod.EMAIL)) {
|
if (!user.authMethods.includes(AuthMethod.EMAIL)) {
|
||||||
await validateProviderAuthToken({
|
await validateProviderAuthToken({
|
||||||
email,
|
email,
|
||||||
user,
|
|
||||||
providerAuthToken,
|
providerAuthToken,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -392,11 +392,9 @@ export const createToken = ({
|
|||||||
|
|
||||||
export const validateProviderAuthToken = async ({
|
export const validateProviderAuthToken = async ({
|
||||||
email,
|
email,
|
||||||
user,
|
|
||||||
providerAuthToken,
|
providerAuthToken,
|
||||||
}: {
|
}: {
|
||||||
email: string;
|
email: string;
|
||||||
user: IUser,
|
|
||||||
providerAuthToken?: string;
|
providerAuthToken?: string;
|
||||||
}) => {
|
}) => {
|
||||||
if (!providerAuthToken) {
|
if (!providerAuthToken) {
|
||||||
@@ -407,10 +405,7 @@ export const validateProviderAuthToken = async ({
|
|||||||
jwt.verify(providerAuthToken, await getJwtProviderAuthSecret())
|
jwt.verify(providerAuthToken, await getJwtProviderAuthSecret())
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (decodedToken.email !== email) {
|
||||||
!user.authMethods.includes(decodedToken.authMethod) ||
|
|
||||||
decodedToken.email !== email
|
|
||||||
) {
|
|
||||||
throw new Error("Invalid authentication credentials.")
|
throw new Error("Invalid authentication credentials.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link>
|
||||||
{/* <Link href={`/project/${currentWorkspace?._id}/audit-logs`} passHref>
|
<Link href={`/project/${currentWorkspace?._id}/audit-logs`} passHref>
|
||||||
<a>
|
<a>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
isSelected={
|
isSelected={
|
||||||
@@ -491,11 +491,11 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
}
|
}
|
||||||
icon="system-outline-168-view-headline"
|
icon="system-outline-168-view-headline"
|
||||||
>
|
>
|
||||||
Audit Logs V2
|
Audit Logs
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</a>
|
</a>
|
||||||
</Link> */}
|
</Link>
|
||||||
<Link href={`/project/${currentWorkspace?._id}/logs`} passHref>
|
{/* <Link href={`/project/${currentWorkspace?._id}/logs`} passHref>
|
||||||
<a>
|
<a>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
isSelected={
|
isSelected={
|
||||||
@@ -506,7 +506,7 @@ export const AppLayout = ({ children }: LayoutProps) => {
|
|||||||
Audit Logs
|
Audit Logs
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</a>
|
</a>
|
||||||
</Link>
|
</Link> */}
|
||||||
{/* <Link href={`/project/${currentWorkspace?._id}/secret-scanning`} passHref>
|
{/* <Link href={`/project/${currentWorkspace?._id}/secret-scanning`} passHref>
|
||||||
<a>
|
<a>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const Logs = () => {
|
|||||||
return (
|
return (
|
||||||
<div className="h-full bg-bunker-800">
|
<div className="h-full bg-bunker-800">
|
||||||
<Head>
|
<Head>
|
||||||
<title>{t("common.head-title", { title: t("billing.title") })}</title>
|
<title>{t("common.head-title", { title: t("settings.project.title") })}</title>
|
||||||
<link rel="icon" href="/infisical.ico" />
|
<link rel="icon" href="/infisical.ico" />
|
||||||
<meta property="og:image" content="/images/message.png" />
|
<meta property="og:image" content="/images/message.png" />
|
||||||
</Head>
|
</Head>
|
||||||
|
|||||||
Reference in New Issue
Block a user