nandi/gleanpublic⑂ Fork 0
⑂ 26469e4
Commits
⬇ Clone ▾
git clone https://git.rickub.com/nandi/glean.git
git clone ssh://git@rickub.com/nandi/glean.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Extract OAuth scopesUnverified

Julien Robert committed 2026-04-21T01:34:34+02:00 Browse files
26469e4 parent: 4a7542a
modified internal/server/server.go +4 -2
@@ -30,6 +30,8 @@ import (
3030 "pkg.rbrt.fr/glean/internal/tmpl"
3131 )
3232
33+var oauthScopes = []string{"atproto", "transition:generic"}
34+
3335 func splitString(s, sep string) []string {
3436 return strings.Split(s, sep)
3537 }
@@ -58,9 +60,9 @@ func New(database *db.DB, clientID, callbackURL, addr string, scheduler *feed.Sc
5860 host = "127.0.0.1" + host
5961 }
6062 cbURL := fmt.Sprintf("http://%s/auth/callback", host)
61- config = oauth.NewLocalhostConfig(cbURL, []string{"atproto", "transition:generic"})
63+ config = oauth.NewLocalhostConfig(cbURL, oauthScopes)
6264 } else {
63- config = oauth.NewPublicConfig(clientID, callbackURL, []string{"atproto", "transition:generic"})
65+ config = oauth.NewPublicConfig(clientID, callbackURL, oauthScopes)
6466 }
6567 oauthClient := oauth.NewClientApp(&config, oauthStore)
6668
@@ -30,6 +30,8 @@ import (
30 "pkg.rbrt.fr/glean/internal/tmpl"30 "pkg.rbrt.fr/glean/internal/tmpl"
31 )31 )
32 32
33+var oauthScopes = []string{"atproto", "transition:generic"}
34+
33 func splitString(s, sep string) []string {35 func splitString(s, sep string) []string {
34 return strings.Split(s, sep)36 return strings.Split(s, sep)
35 }37 }
@@ -58,9 +60,9 @@ func New(database *db.DB, clientID, callbackURL, addr string, scheduler *feed.Sc
58 host = "127.0.0.1" + host60 host = "127.0.0.1" + host
59 }61 }
60 cbURL := fmt.Sprintf("http://%s/auth/callback", host)62 cbURL := fmt.Sprintf("http://%s/auth/callback", host)
61- config = oauth.NewLocalhostConfig(cbURL, []string{"atproto", "transition:generic"})63+ config = oauth.NewLocalhostConfig(cbURL, oauthScopes)
62 } else {64 } else {
63- config = oauth.NewPublicConfig(clientID, callbackURL, []string{"atproto", "transition:generic"})65+ config = oauth.NewPublicConfig(clientID, callbackURL, oauthScopes)
64 }66 }
65 oauthClient := oauth.NewClientApp(&config, oauthStore)67 oauthClient := oauth.NewClientApp(&config, oauthStore)
66 68