Mirror of @tangled.org/core. Running on a Raspberry Pi Zero 2

appview/state: normalize handle on login

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 0dee98c3 f7ac5765

verified
+8 -1
+8 -1
appview/state/login.go
··· 39 39 returnURL := r.FormValue("return_url") 40 40 addAccount := r.FormValue("add_account") == "true" 41 41 42 + // remove spaces around the handle, handles can't have spaces around them 43 + handle = strings.TrimSpace(handle) 44 + 42 45 // when users copy their handle from bsky.app, it tends to have these characters around it: 43 46 // 44 47 // @nelind.dk: ··· 71 68 redirectURL, err := s.oauth.ClientApp.StartAuthFlow(r.Context(), handle) 72 69 if err != nil { 73 70 l.Error("failed to start auth", "err", err) 74 - http.Error(w, err.Error(), http.StatusInternalServerError) 71 + s.pages.Notice( 72 + w, 73 + "login-msg", 74 + fmt.Sprintf("Failed to start auth flow: %v", err), 75 + ) 75 76 return 76 77 } 77 78