@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
43 lines • 1.33 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.accessTokenMock = accessTokenMock;
function accessTokenMock(flow) {
switch (flow) {
case "CredentialsExchange": {
const state = {
claims: {},
};
const build = (api) => ({
setCustomClaim: (name, value) => {
state.claims[name] = value;
return api;
},
});
return { build, state };
}
default: {
const state = {
scopes: [],
claims: {},
};
const build = (api) => ({
addScope: (name) => {
state.scopes = [
...new Set(state.scopes).add(name),
];
return api;
},
removeScope: (name) => {
state.scopes = state.scopes.filter((value) => value !== name);
return api;
},
setCustomClaim: (name, value) => {
state.claims[name] = value;
return api;
},
});
return { build, state };
}
}
}
//# sourceMappingURL=access-token.js.map