this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

store token endpoint URL in auth req info to avoid re-resolution

+5 -8
+2 -8
atproto/auth/oauth/oauth.go
··· 427 427 // Lower-level helper. This is usually invoked as part of [ProcessCallback]. 428 428 func (app *ClientApp) SendInitialTokenRequest(ctx context.Context, authCode string, info AuthRequestData) (*TokenResponse, error) { 429 429 430 - // TODO: don't re-fetch? caching? 431 - authServerMeta, err := app.Resolver.ResolveAuthServerMetadata(ctx, info.AuthServerURL) 432 - if err != nil { 433 - return nil, err 434 - } 435 - 436 430 body := InitialTokenRequest{ 437 431 ClientID: app.Config.ClientID, 438 432 RedirectURI: app.Config.CallbackURL, ··· 465 459 466 460 var resp *http.Response 467 461 for range 2 { 468 - dpopJWT, err := NewAuthDPoP("POST", authServerMeta.TokenEndpoint, dpopServerNonce, dpopPrivKey) 462 + dpopJWT, err := NewAuthDPoP("POST", info.AuthServerTokenEndpoint, dpopServerNonce, dpopPrivKey) 469 463 if err != nil { 470 464 return nil, err 471 465 } 472 466 473 - req, err := http.NewRequestWithContext(ctx, "POST", authServerMeta.TokenEndpoint, bytes.NewBuffer(bodyBytes)) 467 + req, err := http.NewRequestWithContext(ctx, "POST", info.AuthServerTokenEndpoint, bytes.NewBuffer(bodyBytes)) 474 468 if err != nil { 475 469 return nil, err 476 470 }
+3
atproto/auth/oauth/types.go
··· 336 336 // unique token in URI format, which will be used by the client in the auth flow redirect 337 337 RequestURI string `json:"request_uri"` 338 338 339 + // Full token endpoint URL 340 + AuthServerTokenEndpoint string `json:"authserver_token_endpoint"` 341 + 339 342 // The secret token/nonce which a code challenge was generated from 340 343 PKCEVerifier string `json:"pkce_verifier"` 341 344