mirror of
https://github.com/sigmasternchen/threadule
synced 2025-03-14 23:59:00 +00:00
style(backend): revert some style changes
This commit is contained in:
parent
0154537fde
commit
ff535a616f
2 changed files with 8 additions and 10 deletions
|
@ -7,13 +7,11 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultPasswordLength = 16
|
||||
defaultPasswordCharSet = "abcdefghijklmnopqrstuvwxyz" +
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||
"0123456789" +
|
||||
"=!$%&+#-_.,;:"
|
||||
)
|
||||
const defaultPasswordLength = 16
|
||||
const defaultPasswordCharSet = "abcdefghijklmnopqrstuvwxyz" +
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +
|
||||
"0123456789" +
|
||||
"=!$%&+#-_.,;:"
|
||||
|
||||
func (l *Logic) defaultPassword() string {
|
||||
builder := strings.Builder{}
|
||||
|
|
|
@ -3,7 +3,7 @@ package router
|
|||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
"threadule/backend/internal/presentation"
|
||||
. "threadule/backend/internal/presentation"
|
||||
"threadule/backend/internal/web"
|
||||
)
|
||||
|
||||
|
@ -13,14 +13,14 @@ func authenticated(next web.Handler) web.Handler {
|
|||
return func(ctx *web.Context) {
|
||||
authHeader := ctx.Request.Header.Get("Authorization")
|
||||
if !strings.HasPrefix(authHeader, authPrefix) {
|
||||
presentation.StatusResponse(ctx, http.StatusBadRequest, "Authorization header missing or malformed")
|
||||
StatusResponse(ctx, http.StatusBadRequest, "Authorization header missing or malformed")
|
||||
return
|
||||
}
|
||||
authHeader = strings.TrimPrefix(authHeader, authPrefix)
|
||||
|
||||
user, err := ctx.AppCtx.Logic.AuthenticateSession(authHeader)
|
||||
if err != nil {
|
||||
presentation.StatusResponse(ctx, http.StatusUnauthorized, err.Error())
|
||||
StatusResponse(ctx, http.StatusUnauthorized, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue