Skip to content

Commit f764f53

Browse files
authored
Merge pull request #29 from arran4/codex/readd-/oauth2callback-endpoint
Restore OAuth2 callback route
2 parents 8fba013 + c4ae971 commit f764f53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/gobookmarks/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ func main() {
127127
clientID = cfg.Oauth2ClientID
128128
clientSecret = cfg.Oauth2Secret
129129
externalUrl = cfg.ExternalURL
130+
redirectUrl = fmt.Sprintf("%s/oauth2Callback", externalUrl)
130131

131132
if cfg.Provider != "" {
132133
if !SetProviderByName(cfg.Provider) {
@@ -177,6 +178,7 @@ func main() {
177178
r.HandleFunc("/history/commits", runTemplate("historyCommits.gohtml")).Methods("GET").MatcherFunc(RequiresAnAccount())
178179

179180
r.HandleFunc("/logout", runHandlerChain(UserLogoutAction, runTemplate("logoutPage.gohtml"))).Methods("GET")
181+
r.HandleFunc("/oauth2Callback", runHandlerChain(Oauth2CallbackPage, redirectToHandler("/"))).Methods("GET")
180182

181183
r.HandleFunc("/proxy/favicon", FaviconProxyHandler).Methods("GET")
182184

0 commit comments

Comments
 (0)