UNPKG

@atproto/oauth-client

Version:

OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).

20 lines 941 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.atprotoTokenResponseSchema = exports.atprotoScopeSchema = exports.isAtprotoScope = void 0; const did_1 = require("@atproto/did"); const oauth_types_1 = require("@atproto/oauth-types"); const zod_1 = require("zod"); const util_1 = require("./util"); const isAtprotoScope = (input) => (0, util_1.includesSpaceSeparatedValue)(input, 'atproto'); exports.isAtprotoScope = isAtprotoScope; exports.atprotoScopeSchema = zod_1.z .string() .refine(exports.isAtprotoScope, 'The "atproto" scope is required'); exports.atprotoTokenResponseSchema = oauth_types_1.oauthTokenResponseSchema.extend({ token_type: zod_1.z.literal('DPoP'), sub: did_1.atprotoDidSchema, scope: exports.atprotoScopeSchema, // OpenID is not compatible with atproto identities id_token: zod_1.z.never().optional(), }); //# sourceMappingURL=atproto-token-response.js.map