modified internal/server/auth_handler.go +2 -1
| @@ -6,6 +6,7 @@ import ( |
| 6 | 6 | "fmt" |
| 7 | 7 | "net/http" |
| 8 | 8 | "net/url" |
| 9 | + "strings" |
| 9 | 10 | "os" |
| 10 | 11 | |
| 11 | 12 | "github.com/bluesky-social/indigo/atproto/syntax" |
| @@ -20,7 +21,7 @@ func (s *Server) handleAuthLogin(w http.ResponseWriter, r *http.Request) { |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | func (s *Server) handleAuthStart(w http.ResponseWriter, r *http.Request) { |
| 23 | | - handle := r.FormValue("handle") |
| 24 | + handle := strings.TrimPrefix(r.FormValue("handle"), "@") |
| 24 | 25 | if handle == "" { |
| 25 | 26 | http.Error(w, "handle required", http.StatusBadRequest) |
| 26 | 27 | return |
| @@ -6,6 +6,7 @@ import ( |
| 6 | "fmt" | 6 | "fmt" |
| 7 | "net/http" | 7 | "net/http" |
| 8 | "net/url" | 8 | "net/url" |
| | 9 | + "strings" |
| 9 | "os" | 10 | "os" |
| 10 | | 11 | |
| 11 | "github.com/bluesky-social/indigo/atproto/syntax" | 12 | "github.com/bluesky-social/indigo/atproto/syntax" |
| @@ -20,7 +21,7 @@ func (s *Server) handleAuthLogin(w http.ResponseWriter, r *http.Request) { |
| 20 | } | 21 | } |
| 21 | | 22 | |
| 22 | func (s *Server) handleAuthStart(w http.ResponseWriter, r *http.Request) { | 23 | func (s *Server) handleAuthStart(w http.ResponseWriter, r *http.Request) { |
| 23 | - handle := r.FormValue("handle") | 24 | + handle := strings.TrimPrefix(r.FormValue("handle"), "@") |
| 24 | if handle == "" { | 25 | if handle == "" { |
| 25 | http.Error(w, "handle required", http.StatusBadRequest) | 26 | http.Error(w, "handle required", http.StatusBadRequest) |
| 26 | return | 27 | return |