mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Login fixes (#3555)
* Don't redirect /logout * Improve login page styling on mobile
This commit is contained in:
@@ -13,7 +13,10 @@ import (
|
|||||||
"github.com/stashapp/stash/pkg/session"
|
"github.com/stashapp/stash/pkg/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
const loginEndPoint = "/login"
|
const (
|
||||||
|
loginEndPoint = "/login"
|
||||||
|
logoutEndPoint = "/logout"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
tripwireActivatedErrMsg = "Stash is exposed to the public internet without authentication, and is not serving any more content to protect your privacy. " +
|
tripwireActivatedErrMsg = "Stash is exposed to the public internet without authentication, and is not serving any more content to protect your privacy. " +
|
||||||
@@ -27,7 +30,7 @@ const (
|
|||||||
|
|
||||||
func allowUnauthenticated(r *http.Request) bool {
|
func allowUnauthenticated(r *http.Request) bool {
|
||||||
// #2715 - allow access to UI files
|
// #2715 - allow access to UI files
|
||||||
return strings.HasPrefix(r.URL.Path, loginEndPoint) || r.URL.Path == "/css" || strings.HasPrefix(r.URL.Path, "/assets")
|
return strings.HasPrefix(r.URL.Path, loginEndPoint) || r.URL.Path == logoutEndPoint || r.URL.Path == "/css" || strings.HasPrefix(r.URL.Path, "/assets")
|
||||||
}
|
}
|
||||||
|
|
||||||
func authenticateHandler() func(http.Handler) http.Handler {
|
func authenticateHandler() func(http.Handler) http.Handler {
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ func Start() error {
|
|||||||
|
|
||||||
// session handlers
|
// session handlers
|
||||||
r.Post(loginEndPoint, handleLogin(loginUIBox))
|
r.Post(loginEndPoint, handleLogin(loginUIBox))
|
||||||
r.Get("/logout", handleLogout(loginUIBox))
|
r.Get(logoutEndPoint, handleLogout(loginUIBox))
|
||||||
|
|
||||||
r.Get(loginEndPoint, getLoginHandler(loginUIBox))
|
r.Get(loginEndPoint, getLoginHandler(loginUIBox))
|
||||||
|
|
||||||
|
|||||||
@@ -115,3 +115,18 @@ button, input {
|
|||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 576px) {
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dialog {
|
||||||
|
height: auto;
|
||||||
|
margin-top: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user