~sircmpwn/gql.sr.ht

1fd9e352177eb4f56583e66123eba997931321dc — Drew DeVault 2 months ago 8eb53f3
s/Scopes/Grants/g
2 files changed, 3 insertions(+), 3 deletions(-)

M auth/middleware.go
M auth/token.go
M auth/middleware.go => auth/middleware.go +2 -2
@@ 405,9 405,9 @@ func OAuth2(db *sql.DB, token string, hash [64]byte,
	user.AuthMethod = AUTH_OAUTH2
	user.OAuth2Token = ot

	if ot.Scopes != "" {
	if ot.Grants != "" {
		user.Access = make(map[string]string)
		for _, grant := range strings.Split(ot.Scopes, ",") {
		for _, grant := range strings.Split(ot.Grants, ",") {
			var (
				service string
				scope   string

M auth/token.go => auth/token.go +1 -1
@@ 26,7 26,7 @@ func ToTimestamp(t time.Time) Timestamp {
type OAuth2Token struct {
	Version  uint
	Expires  Timestamp
	Scopes   string
	Grants   string
	ClientID string
	Username string
}