From 390e5120e11bc7715cd1b13c8c1e0c2460d9fc96 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 12 Nov 2025 21:27:51 +0000 Subject: [PATCH] Forward from the notification URL to the oauth flow --- endpoint.go | 8 ++++++++ main.go | 1 + 2 files changed, 9 insertions(+) diff --git a/endpoint.go b/endpoint.go index d2d73e72..c59e40e2 100644 --- a/endpoint.go +++ b/endpoint.go @@ -42,6 +42,14 @@ func getFavicon(w http.ResponseWriter, r *http.Request) { http.ServeFile(w, r, "static/favicon.ico") } +func getOAuthRefresh(w http.ResponseWriter, r *http.Request) { + user, err := getAuthenticatedUser(r) + if err != nil { + http.Redirect(w, r, "/?next=/oauth/refresh", http.StatusFound) + } + htmlOauthPrompt(w, user) +} + func getPhoneCall(w http.ResponseWriter, r *http.Request) { htmlPhoneCall(w) } diff --git a/main.go b/main.go index 4eacc0c7..9e867b68 100644 --- a/main.go +++ b/main.go @@ -64,6 +64,7 @@ func main() { r.Get("/arcgis/oauth/begin", getArcgisOauthBegin) r.Get("/arcgis/oauth/callback", getArcgisOauthCallback) r.Get("/qr-code/report/{code}", getQRCodeReport) + r.Get("/oauth/refresh", getOAuthRefresh) r.Get("/phone-call", getPhoneCall) r.Get("/report", getReport) r.Get("/report/{code}", getReportDetail)