CustomRedirectToLogin redirects the user to the login page with the `message` and `redirect` query parameters set, with a provided code
(rw http.ResponseWriter, r *http.Request, redirect string, message string, code int)
| 1031 | // CustomRedirectToLogin redirects the user to the login page with the `message` and |
| 1032 | // `redirect` query parameters set, with a provided code |
| 1033 | func CustomRedirectToLogin(rw http.ResponseWriter, r *http.Request, redirect string, message string, code int) { |
| 1034 | q := url.Values{} |
| 1035 | q.Add("message", message) |
| 1036 | q.Add("redirect", redirect) |
| 1037 | |
| 1038 | u := &url.URL{ |
| 1039 | Path: "/login", |
| 1040 | RawQuery: q.Encode(), |
| 1041 | } |
| 1042 | |
| 1043 | http.Redirect(rw, r, u.String(), code) |
| 1044 | } |
no test coverage detected