File tree Expand file tree Collapse file tree 3 files changed +2
-12
lines changed
Expand file tree Collapse file tree 3 files changed +2
-12
lines changed Original file line number Diff line number Diff line change 11import { RequestHandler } from "express" ;
22import { z } from "zod" ;
3- import { isValidUrl } from "../validation.js" ;
43import { OAuthServerProvider } from "../provider.js" ;
54
65export type AuthorizationHandlerOptions = {
@@ -10,7 +9,7 @@ export type AuthorizationHandlerOptions = {
109// Parameters that must be validated in order to issue redirects.
1110const ClientAuthorizationParamsSchema = z . object ( {
1211 client_id : z . string ( ) ,
13- redirect_uri : z . string ( ) . optional ( ) . refine ( ( value ) => value === undefined || isValidUrl ( value ) , { message : "redirect_uri must be a valid URL" } ) ,
12+ redirect_uri : z . string ( ) . optional ( ) . refine ( ( value ) => value === undefined || URL . canParse ( value ) , { message : "redirect_uri must be a valid URL" } ) ,
1413} ) ;
1514
1615// Parameters that must be validated for a successful authorization request. Failure can be reported to the redirect URI.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { z } from "zod" ;
2- import { isValidUrl } from "../server/auth/validation.js" ;
32
43/**
54 * RFC 8414 OAuth 2.0 Authorization Server Metadata
@@ -62,7 +61,7 @@ export const OAuthErrorSchema = z
6261 * RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
6362 */
6463export const OAuthClientMetadataSchema = z . object ( {
65- redirect_uris : z . array ( z . string ( ) ) . refine ( ( uris ) => uris . every ( isValidUrl ) , { message : "redirect_uris must contain valid URLs" } ) ,
64+ redirect_uris : z . array ( z . string ( ) ) . refine ( ( uris ) => uris . every ( ( uri ) => URL . canParse ( uri ) ) , { message : "redirect_uris must contain valid URLs" } ) ,
6665 token_endpoint_auth_method : z . string ( ) . optional ( ) ,
6766 grant_types : z . array ( z . string ( ) ) . optional ( ) ,
6867 response_types : z . array ( z . string ( ) ) . optional ( ) ,
You can’t perform that action at this time.
0 commit comments