Redirect on successfull login
This commit is contained in:
@ -38,8 +38,13 @@ func LoginSubmit(f *fiber.Ctx) error {
|
||||
hasError = true
|
||||
}
|
||||
|
||||
if !hasError && !checkUsernamePassword(content.Username, content.Password) {
|
||||
content.LoginError = "Invalid username or password"
|
||||
if !hasError {
|
||||
if checkUsernamePassword(content.Username, content.Password) {
|
||||
f.Set("HX-Location", "/")
|
||||
return nil
|
||||
} else {
|
||||
content.LoginError = "Invalid username or password"
|
||||
}
|
||||
}
|
||||
|
||||
Render(f, templates.LoginFormContent(content))
|
||||
|
||||
Reference in New Issue
Block a user