···8787 _ = sessData.AccountDID
8888 _ = sessData.SessionID
89899090+ // the returned scopes might not include all of those requested
9191+ _ = sessData.Scopes
9292+9093 http.Redirect(w, r, "/app", http.StatusFound)
9194 }
9295
+1-5
atproto/auth/oauth/oauth.go
···635635 }
636636 }
637637638638- // TODO: could be flexible instead of considering this a hard failure?
639639- if tokenResp.Scope != info.Scope {
640640- return nil, fmt.Errorf("token scope didn't match original request")
641641- }
642642-643638 sessData := ClientSessionData{
644639 AccountDID: accountDID,
645640 SessionID: info.State,
641641+ Scopes: strings.Split(tokenResp.Scope, " "),
646642 HostURL: hostURL,
647643 AuthServerURL: info.AuthServerURL,
648644 AccessToken: tokenResp.AccessToken,
+3
atproto/auth/oauth/session.go
···3939 // Full token endpoint
4040 AuthServerTokenEndpoint string `json:"authserver_token_endpoint"`
41414242+ // The set of scopes approved for this session (returned in the initial token request)
4343+ Scopes []string `json:"scopes"`
4444+4245 // Token which can be used directly against host ("resource server", eg PDS)
4346 AccessToken string `json:"access_token"`
4447