File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,14 +28,17 @@ export const handleResolver = new AtprotoDohHandleResolver({
2828 * Generates the OAuth client metadata. pkAlg is used to signify that the OAuth client is confidential
2929 */
3030export function getOauthClientMetadata ( pkAlg : string | undefined = undefined ) : OAuthClientMetadata {
31- const dev = import . meta. dev
32-
33- const client_uri = clientUri
3431 const redirect_uri : OAuthRedirectUri = oauthRedirectUriSchema . parse (
35- `${ client_uri } /api/auth/atproto` ,
32+ `${ clientUri } /api/auth/atproto` ,
3633 )
34+
35+ const client_id =
36+ import . meta. dev || import . meta. test
37+ ? `http://localhost?redirect_uri=${ encodeURIComponent ( redirect_uri ) } &scope=${ encodeURIComponent ( scope ) } `
38+ : `${ clientUri } /oauth-client-metadata.json`
39+
3740 const jwks_uri : WebUri | undefined = pkAlg
38- ? webUriSchema . parse ( `${ client_uri } /.well-known/jwks.json` )
41+ ? webUriSchema . parse ( `${ clientUri } /.well-known/jwks.json` )
3942 : undefined
4043
4144 // If anything changes here, please make sure to also update /shared/schemas/oauth.ts to match
You can’t perform that action at this time.
0 commit comments