diff --git a/src/helper/token.ts b/src/helper/token.ts index 7249a2b..056b277 100644 --- a/src/helper/token.ts +++ b/src/helper/token.ts @@ -9,7 +9,7 @@ export const getServiceAccountName = async (token: string) => { const decodedPayload = JSON.parse(atob(payload.replace(/-/g, '+').replace(/_/g, '/'))); // Extract the 'sub' field - const sub = decodedPayload['kubernetes.io/serviceaccount/service-account.name']; - + const sub = decodedPayload['kubernetes.io/serviceaccount/service-account.name'] || + decodedPayload["kubernetes.io"].serviceaccount.name; return sub || null; };