feat: updated docs and added description to files
This commit is contained in:
17
Backend/endpoints/user-login.go
Normal file
17
Backend/endpoints/user-login.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package endpoints
|
||||
|
||||
// this endpoint server at "/user/login" will show the login page or
|
||||
// directly login the user based on the http method used
|
||||
|
||||
import "net/http"
|
||||
|
||||
func LoginHandler(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
showLoginPage(w, r, true, "")
|
||||
case http.MethodPost:
|
||||
loginUser(w, r)
|
||||
default:
|
||||
http.Error(w, "Method not allowed!", http.StatusMethodNotAllowed)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user