MCPcopy Index your code
hub / github.com/coder/coder / CustomRedirectToLogin

Function CustomRedirectToLogin

coderd/httpmw/apikey.go:1033–1044  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1031// CustomRedirectToLogin redirects the user to the login page with the `message` and
1032// `redirect` query parameters set, with a provided code
1033func 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}

Callers 1

userOAuth2GithubMethod · 0.92

Calls 3

EncodeMethod · 0.80
AddMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected