Monorepo for Tangled tangled.org
10

Configure Feed

Select the types of activity you want to include in your feed.

appview: redirect back to home when switched account on login page

follow `return_url` param or send back to `/`

Signed-off-by: Seongmin Lee <git@boltless.me>

author
Seongmin Lee
committer
Tangled
date (May 14, 2026, 5:34 AM +0300) commit fd432b9b parent c38881b4 change-id xtprkykq
+9 -2
+4 -1
appview/pages/templates/user/login.html
··· 22 22 <button 23 23 type="button" 24 24 hx-post="/account/switch" 25 - hx-vals='{"did": "{{ .Did }}"}' 25 + hx-include="this" 26 26 hx-swap="none" 27 27 class="flex items-center gap-2 flex-1 text-left min-w-0" 28 28 > 29 + {{ $returnUrl := (or $.ReturnUrl "/") }} 30 + <input type="hidden" name="did" value="{{ .Did }}"> 31 + <input type="hidden" name="return_url" value="{{ $returnUrl }}"> 29 32 {{ template "user/fragments/pic" (list .Did "size-8") }} 30 33 <div class="flex flex-col min-w-0"> 31 34 <span class="text-sm font-medium dark:text-white truncate">{{ .Did | resolve | truncateAt30 }}</span>
+5 -1
appview/state/accounts.go
··· 34 34 } 35 35 36 36 l.Info("switched account", "did", did) 37 - s.pages.HxRefresh(w) 37 + if returnUrl := r.FormValue("return_url"); returnUrl != "" { 38 + s.pages.HxRedirect(w, returnUrl) 39 + } else { 40 + s.pages.HxRefresh(w) 41 + } 38 42 } 39 43 40 44 func (s *State) RemoveAccount(w http.ResponseWriter, r *http.Request) {