const createAuthorizationURL = (clientInfo: ClientInfo, options?: Options) => Effect.gen(function* (_) {
const scopes = new Set(options?.scopes); // remove duplicates
const authorizationUrl = yield* Effect.try({
try: () => new URL(clientInfo.authorizeEndpoint),
catch: () => new Cause.IllegalArgumentException(`Failed to create authorization URL: "${clientInfo.authorizeEndpoint}" is not a valid URL.`)
});
return authorizationUrl;
});
const createAuthorizationURL = (clientInfo: ClientInfo, options?: Options) => Effect.gen(function* (_) {
const scopes = new Set(options?.scopes); // remove duplicates
const authorizationUrl = yield* Effect.try({
try: () => new URL(clientInfo.authorizeEndpoint),
catch: () => new Cause.IllegalArgumentException(`Failed to create authorization URL: "${clientInfo.authorizeEndpoint}" is not a valid URL.`)
});
return authorizationUrl;
});