this repo has no description
0
fork

Configure Feed

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

leave partial scopes validation to calling code

+7 -5
+3
atproto/auth/oauth/doc.go
··· 87 87 _ = sessData.AccountDID 88 88 _ = sessData.SessionID 89 89 90 + // the returned scopes might not include all of those requested 91 + _ = sessData.Scopes 92 + 90 93 http.Redirect(w, r, "/app", http.StatusFound) 91 94 } 92 95
+1 -5
atproto/auth/oauth/oauth.go
··· 635 635 } 636 636 } 637 637 638 - // TODO: could be flexible instead of considering this a hard failure? 639 - if tokenResp.Scope != info.Scope { 640 - return nil, fmt.Errorf("token scope didn't match original request") 641 - } 642 - 643 638 sessData := ClientSessionData{ 644 639 AccountDID: accountDID, 645 640 SessionID: info.State, 641 + Scopes: strings.Split(tokenResp.Scope, " "), 646 642 HostURL: hostURL, 647 643 AuthServerURL: info.AuthServerURL, 648 644 AccessToken: tokenResp.AccessToken,
+3
atproto/auth/oauth/session.go
··· 39 39 // Full token endpoint 40 40 AuthServerTokenEndpoint string `json:"authserver_token_endpoint"` 41 41 42 + // The set of scopes approved for this session (returned in the initial token request) 43 + Scopes []string `json:"scopes"` 44 + 42 45 // Token which can be used directly against host ("resource server", eg PDS) 43 46 AccessToken string `json:"access_token"` 44 47