mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-16 19:28:35 +00:00
Modify service token format
This commit is contained in:
@@ -6,8 +6,7 @@ import {
|
||||
getAuthUserPayload,
|
||||
getAuthSTDPayload
|
||||
} from '../helpers/auth';
|
||||
import { JWT_AUTH_SECRET } from '../config';
|
||||
import { AccountNotFoundError, BadRequestError, UnauthorizedRequestError } from '../utils/errors';
|
||||
import { BadRequestError } from '../utils/errors';
|
||||
|
||||
declare module 'jsonwebtoken' {
|
||||
export interface UserIDJwtPayload extends jwt.JwtPayload {
|
||||
|
||||
@@ -40,10 +40,10 @@ const requireWorkspaceAuth = ({
|
||||
if (
|
||||
req.serviceTokenData
|
||||
&& req.serviceTokenData.workspace !== workspaceId
|
||||
&& req.serviceTokenData.environment !== req.body.environment
|
||||
)
|
||||
// case: st auth
|
||||
&& req.serviceTokenData.environment !== req.query.environment
|
||||
) {
|
||||
next(UnauthorizedRequestError({message: 'Unable to authenticate workspace'}))
|
||||
}
|
||||
|
||||
return next();
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user