Check v2 workspace membership routes (currently not routed)

This commit is contained in:
Tuan Dang
2023-01-14 21:07:17 +07:00
parent e2b4adb2e9
commit 5085376f11
4 changed files with 5 additions and 4 deletions
@@ -302,7 +302,7 @@ export const getWorkspaceMemberships = async (req: Request, res: Response) => {
Sentry.setUser({ email: req.user.email }); Sentry.setUser({ email: req.user.email });
Sentry.captureException(err); Sentry.captureException(err);
return res.status(400).send({ return res.status(400).send({
message: 'Failed to get workspace members' message: 'Failed to get workspace memberships'
}); });
} }
@@ -45,7 +45,8 @@ const requireMembershipAuth = ({
}); });
req.targetMembership = targetMembership; req.targetMembership = targetMembership;
return next();
} catch (err) { } catch (err) {
return next(UnauthorizedRequestError({ return next(UnauthorizedRequestError({
message: 'Unable to validate workspace membership' message: 'Unable to validate workspace membership'
+1 -1
View File
@@ -68,7 +68,7 @@ router.get(
workspaceController.getWorkspaceServiceTokenData 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 router.get( // new - TODO: rewire dashboard to this route
'/:workspaceId/memberships', '/:workspaceId/memberships',
@@ -61,7 +61,7 @@ const attemptLogin = async (
// if everything works, go the main dashboard page. // if everything works, go the main dashboard page.
const { token, publicKey, encryptedPrivateKey, iv, tag } = const { token, publicKey, encryptedPrivateKey, iv, tag } =
await login2(email, clientProof); await login2(email, clientProof);
SecurityClient.setToken(token); SecurityClient.setToken(token);
const privateKey = Aes256Gcm.decrypt({ const privateKey = Aes256Gcm.decrypt({