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 1
1
import { RequestHandler } from "express" ;
2
2
import { z } from "zod" ;
3
- import { isValidUrl } from "../validation.js" ;
4
3
import { OAuthServerProvider } from "../provider.js" ;
5
4
6
5
export type AuthorizationHandlerOptions = {
@@ -10,7 +9,7 @@ export type AuthorizationHandlerOptions = {
10
9
// Parameters that must be validated in order to issue redirects.
11
10
const ClientAuthorizationParamsSchema = z . object ( {
12
11
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" } ) ,
14
13
} ) ;
15
14
16
15
// 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 1
1
import { z } from "zod" ;
2
- import { isValidUrl } from "../server/auth/validation.js" ;
3
2
4
3
/**
5
4
* RFC 8414 OAuth 2.0 Authorization Server Metadata
@@ -62,7 +61,7 @@ export const OAuthErrorSchema = z
62
61
* RFC 7591 OAuth 2.0 Dynamic Client Registration metadata
63
62
*/
64
63
export 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" } ) ,
66
65
token_endpoint_auth_method : z . string ( ) . optional ( ) ,
67
66
grant_types : z . array ( z . string ( ) ) . optional ( ) ,
68
67
response_types : z . array ( z . string ( ) ) . optional ( ) ,
You can’t perform that action at this time.
0 commit comments