feat/authentication

+ moved pkg/auth-helper to internal/lib/auth
+ update AuthInfo
+ cleaning
This commit is contained in:
2025-10-26 21:29:53 +07:00
parent b5b0a8183d
commit 2c432a7bef
33 changed files with 227 additions and 121 deletions

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
package authhelper
import (
"errors"
"net/http"
)
func GetAuthInfo(r *http.Request) (*AuthInfo, error) {
ctxVal := r.Context().Value(AuthKey{})
if ctxVal == nil {
return nil, errors.New("can't get auth info")
}
authInfo := ctxVal.(*AuthInfo)
return authInfo, nil
}