refac: GET /v1/auth/registration
This commit is contained in:
1 parent
61828783a1
commit
2a64991916
6 files changed
+329
No files matched your search
@@ -129,6 +129,12 @@ func (h *LoginHandler) Register(w http.ResponseWriter, r *http.Request) {
|
||||
_, _ = w.Write(message)
|
||||
}
|
||||
|
||||
func (h *LoginHandler) RegistrationStatus(w http.ResponseWriter, _ *http.Request) {
|
||||
body, _ := json.Marshal(map[string]bool{"open": h.CreateUseCase.IsRegistrationOpen()})
|
||||
w.Header().Set("Cache-Control", "no-store")
|
||||
_, _ = w.Write(body)
|
||||
}
|
||||
|
||||
func (h *LoginHandler) Logout(w http.ResponseWriter, _ *http.Request) {
|
||||
removeJwtCookie(w, h.IsProduction)
|
||||
message, _ := json.Marshal(map[string]any{"message": "User logged out! HTTPonly jwt cookie deleted"})
|
||||
|
||||
Reference in new issue
Block a user