fix auth stuff

This commit is contained in:
2025-12-18 14:04:26 -05:00
parent 7bc4e9b846
commit ec095a3955
2 changed files with 54 additions and 3 deletions

25
auth/auth0/session.go Normal file
View File

@@ -0,0 +1,25 @@
package auth0
import "encoding/json"
type SessionUser struct {
Sub string `json:"sub"`
Name string `json:"name"`
Email string `json:"email"`
Picture string `json:"picture"`
Custom json.RawMessage `json:"-"`
}
func (u *SessionUser) CustomClaims() (map[string]any, error) {
if len(u.Custom) == 0 {
return nil, nil
}
var claims map[string]any
if err := json.Unmarshal(u.Custom, &claims); err != nil {
return nil, err
}
return claims, nil
}