(w http.ResponseWriter, message string)
| 208 | } |
| 209 | |
| 210 | func showError(w http.ResponseWriter, message string) { |
| 211 | log.Printf("ERROR: %s", message) |
| 212 | html := fmt.Sprintf(` |
| 213 | <!DOCTYPE html> |
| 214 | <html> |
| 215 | <head> |
| 216 | <title>OAuth2 Test - Error</title> |
| 217 | <style> |
| 218 | body { font-family: Arial, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; } |
| 219 | .status { padding: 20px; margin: 20px 0; border-radius: 5px; } |
| 220 | .error { background: #f8d7da; color: #721c24; } |
| 221 | pre { background: #f5f5f5; padding: 15px; overflow-x: auto; } |
| 222 | </style> |
| 223 | </head> |
| 224 | <body> |
| 225 | <h1>OAuth2 Test Server - Error</h1> |
| 226 | <div class="status error"> |
| 227 | <h2>❌ Error</h2> |
| 228 | <p>%s</p> |
| 229 | </div> |
| 230 | <p>Check the server logs for more details.</p> |
| 231 | </body> |
| 232 | </html>`, message) |
| 233 | w.Header().Set("Content-Type", "text/html") |
| 234 | w.WriteHeader(http.StatusBadRequest) |
| 235 | _, _ = fmt.Fprint(w, html) |
| 236 | } |
| 237 | |
| 238 | func showSuccess(w http.ResponseWriter, code string, tokenResp *TokenResponse, opts ServerOptions) { |
| 239 | log.Printf("SUCCESS: Token exchange completed") |
no test coverage detected