Caddy module to require at-proto authentication and restrict routes to DIDs
3

Configure Feed

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

feat: implement /logout handler for both modes

+25 -15
+7
gate.go
··· 159 159 w.Header().Set("Content-Type", "application/json") 160 160 return json.NewEncoder(w).Encode(meta) 161 161 } 162 + if r.URL.Path == "/logout" { 163 + // Clear session cookie 164 + http.SetCookie(w, g.sessions.ClearCookie(g.Domain)) 165 + http.Redirect(w, r, "/login", http.StatusFound) 166 + return nil 167 + } 168 + 162 169 if r.URL.Path == "/callback" { 163 170 // Process callback 164 171 sessionData, handle, err := g.oauth.ProcessCallback(r.Context(), r.URL.Query())
+11 -15
internal/ui/templates/login.html
··· 13 13 --primary-color: #0085ff; 14 14 --primary-hover: #006bd1; 15 15 --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 16 + --error-bg: #fde8e8; 17 + --error-border: #f98080; 18 + --error-text: #c81e1e; 16 19 } 17 20 18 21 @media (prefers-color-scheme: dark) { ··· 22 25 --text-color: #ffffff; 23 26 --border-color: #444444; 24 27 --shadow: 0 4px 6px rgba(0, 0, 0, 0.3); 28 + --error-bg: #3e1b1b; 29 + --error-border: #6d2626; 30 + --error-text: #f8b4b4; 25 31 } 26 32 } 27 33 ··· 121 127 } 122 128 123 129 .error-alert { 124 - background-color: #fde8e8; 125 - border: 1px solid #f98080; 126 - color: #c81e1e; 130 + background-color: var(--error-bg); 131 + border: 1px solid var(--error-border); 132 + color: var(--error-text); 127 133 padding: 0.75rem; 128 134 border-radius: 6px; 129 135 margin-bottom: 1.5rem; 130 136 font-size: 0.9rem; 131 137 } 132 - 133 - @media (prefers-color-scheme: dark) { 134 - .error-alert { 135 - background-color: #3e1b1b; 136 - border-color: #6d2626; 137 - color: #f8b4b4; 138 - } 139 - } 140 138 </style> 141 139 </head> 142 140 <body> ··· 149 147 </svg> 150 148 </div> 151 149 <h1>Sign in with your internet handle</h1> 152 - 150 + 153 151 {{ if .Error }} 154 - <div class="error-alert"> 155 - {{ .Error }} 156 - </div> 152 + <div class="error-alert">{{ .Error }}</div> 157 153 {{ end }} 158 154 159 155 <form action="/login" method="POST">
+7
portal.go
··· 235 235 return nil 236 236 } 237 237 238 + // 5. Logout 239 + if r.URL.Path == "/logout" { 240 + http.SetCookie(w, p.sessions.ClearCookie(p.Domain)) 241 + http.Redirect(w, r, "/login", http.StatusFound) 242 + return nil 243 + } 244 + 238 245 return next.ServeHTTP(w, r) 239 246 } 240 247