Skip to content

Commit

Permalink
Check v2 workspace membership routes (currently not routed)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangtony98 committed Jan 14, 2023
1 parent e2b4adb commit 5085376
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/controllers/v2/workspaceController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
});
}

Expand Down
3 changes: 2 additions & 1 deletion backend/src/middleware/requireMembershipAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ const requireMembershipAuth = ({
});

req.targetMembership = targetMembership;


return next();
} catch (err) {
return next(UnauthorizedRequestError({
message: 'Unable to validate workspace membership'
Expand Down
2 changes: 1 addition & 1 deletion backend/src/routes/v2/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/utilities/attemptLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 5085376

Please sign in to comment.