Skip to content

Commit 185d4b8

Browse files
committed
rebase fixes
1 parent d3d91f8 commit 185d4b8

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

server/utils/atproto/oauth.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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
*/
3030
export 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

0 commit comments

Comments
 (0)