diff --git a/appview/oauth/handler/handler.go b/appview/oauth/handler/handler.go index f342b997..62aff886 100644 --- a/appview/oauth/handler/handler.go +++ b/appview/oauth/handler/handler.go @@ -35,12 +35,12 @@ type OAuthHandler struct { func (o *OAuthHandler) Router() http.Handler { r := chi.NewRouter() - // gets mounted on /oauth - r.Get("/client-metadata.json", o.clientMetadata) - r.Get("/jwks.json", o.jwks) r.Get("/login", o.login) r.Post("/login", o.login) - r.Get("/callback", o.callback) + + r.Get("/oauth/client-metadata.json", o.clientMetadata) + r.Get("/oauth/jwks.json", o.jwks) + r.Get("/oauth/callback", o.callback) return r } @@ -84,11 +84,10 @@ func (o *OAuthHandler) jwks(w http.ResponseWriter, r *http.Request) { json.NewEncoder(w).Encode(response) } -// temporary until we swap out the main login page func (o *OAuthHandler) login(w http.ResponseWriter, r *http.Request) { switch r.Method { case http.MethodGet: - o.Pages.OAuthLogin(w, pages.LoginParams{}) + o.Pages.Login(w, pages.LoginParams{}) case http.MethodPost: handle := strings.TrimPrefix(r.FormValue("handle"), "@") diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 58af5e77..8a74a3c3 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -249,10 +249,6 @@ func (p *Pages) Login(w io.Writer, params LoginParams) error { return p.executePlain("user/login", w, params) } -func (p *Pages) OAuthLogin(w io.Writer, params LoginParams) error { - return p.executePlain("user/oauthlogin", w, params) -} - type TimelineParams struct { LoggedInUser *oauth.User Timeline []db.TimelineEvent diff --git a/appview/pages/templates/user/login.html b/appview/pages/templates/user/login.html index b0a0785d..b251f433 100644 --- a/appview/pages/templates/user/login.html +++ b/appview/pages/templates/user/login.html @@ -8,55 +8,43 @@ content="width=device-width, initial-scale=1.0" /> - + login -
-

+
+

tangled

tightly-knit social coding.

- - - You need to use your - Bluesky handle to log - in. - -
- -
- - - Generate an app password - here. + + Use your + Bluesky handle to log + in. You will then be redirected to your PDS to + complete authentication.
@@ -70,7 +58,8 @@

- Join our Discord or IRC channel: + Join our Discord or + IRC channel: #tangled on Libera Chat. diff --git a/appview/pages/templates/user/oauthlogin.html b/appview/pages/templates/user/oauthlogin.html deleted file mode 100644 index 1eaaead1..00000000 --- a/appview/pages/templates/user/oauthlogin.html +++ /dev/null @@ -1,71 +0,0 @@ -{{ define "user/oauthlogin" }} - - - - - - - - login - - -

-

- tangled -

-

- tightly-knit social coding. -

-
-
- - - - Use your - Bluesky handle to log - in. You will then be redirected to your PDS to - complete authentication. - -
- - -
-

- Join our Discord or - IRC channel: - #tangled on Libera Chat. -

-

-
- - -{{ end }} diff --git a/appview/state/router.go b/appview/state/router.go index 44605b4b..d8a5ad34 100644 --- a/appview/state/router.go +++ b/appview/state/router.go @@ -200,11 +200,6 @@ func (s *State) StandardRouter() http.Handler { r.With(middleware.AuthMiddleware(s.oauth)).Post("/logout", s.Logout) - // r.Route("/login", func(r chi.Router) { - // r.Get("/", s.Login) - // r.Post("/", s.Login) - // }) - r.Route("/knots", func(r chi.Router) { r.Use(middleware.AuthMiddleware(s.oauth)) r.Get("/", s.Knots) @@ -250,7 +245,7 @@ func (s *State) StandardRouter() http.Handler { }) r.Mount("/settings", s.SettingsRouter()) - r.Mount("/oauth", s.OAuthRouter()) + r.Mount("/", s.OAuthRouter()) r.Get("/keys/{user}", s.Keys) r.NotFound(func(w http.ResponseWriter, r *http.Request) {