Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Check v2 workspace membership routes (currently not routed)

Tuan Dang5085376f11f8
diff --git a/backend/src/controllers/v2/workspaceController.ts b/backend/src/controllers/v2/workspaceController.ts
index 3f929ee4a5..39a1be5fdd 100644
--- a/backend/src/controllers/v2/workspaceController.ts
+++ b/backend/src/controllers/v2/workspaceController.ts
@@ -302,7 +302,7 @@ export const getWorkspaceMemberships = async (req: Request, res: Response) => {
Sentry.setUser({ email: req.user.email });
Sentry.captureException(err);
return res.status(400).send({
- message: 'Failed to get workspace members'
+ message: 'Failed to get workspace memberships'
});
}
diff --git a/backend/src/middleware/requireMembershipAuth.ts b/backend/src/middleware/requireMembershipAuth.ts
index b44d25ceb6..06c0980a35 100644
--- a/backend/src/middleware/requireMembershipAuth.ts
+++ b/backend/src/middleware/requireMembershipAuth.ts
@@ -45,7 +45,8 @@ const requireMembershipAuth = ({
});
req.targetMembership = targetMembership;
-
+
+ return next();
} catch (err) {
return next(UnauthorizedRequestError({
message: 'Unable to validate workspace membership'
diff --git a/backend/src/routes/v2/workspace.ts b/backend/src/routes/v2/workspace.ts
index ebbfe0d4c1..ca920e15ae 100644
--- a/backend/src/routes/v2/workspace.ts
+++ b/backend/src/routes/v2/workspace.ts
@@ -68,7 +68,7 @@ router.get(
workspaceController.getWorkspaceServiceTokenData
);
-// TODO: /POST to create membership
+// TODO: /POST to create membership and re-route inviting user to workspace there
router.get( // new - TODO: rewire dashboard to this route
'/:workspaceId/memberships',
diff --git a/frontend/components/utilities/attemptLogin.ts b/frontend/components/utilities/attemptLogin.ts
index f1aa03ffb9..1a960af10e 100644
--- a/frontend/components/utilities/attemptLogin.ts
+++ b/frontend/components/utilities/attemptLogin.ts
@@ -61,7 +61,7 @@ const attemptLogin = async (
// if everything works, go the main dashboard page.
const { token, publicKey, encryptedPrivateKey, iv, tag } =
await login2(email, clientProof);
-
+
SecurityClient.setToken(token);
const privateKey = Aes256Gcm.decrypt({