@kilterset/auth0-actions-testing
Version:
Test and develop Auth0 Actions or Okta CIC Actions locally.
36 lines • 866 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.oAuth = void 0;
const SCOPES = [
"openid",
"profile",
"email",
"offline_access",
"phone",
];
const RESPONSE_TYPES = [
"code",
"token",
"id_token",
"none",
"code id_token",
"token id_token",
"code token",
"code id_token token",
];
const oAuth = (chance) => {
return {
scopes: (options) => {
const opts = options || { max: SCOPES.length };
const n = "length" in opts
? opts.length
: chance.integer({ min: opts.min || 1, max: opts.max });
return chance.pickset([...SCOPES], n);
},
responseType: () => {
return chance.pickone([...RESPONSE_TYPES]);
},
};
};
exports.oAuth = oAuth;
//# sourceMappingURL=oauth.js.map