Reconfigure log & make auth more robust
This commit is contained in:
@@ -48,12 +48,12 @@ func New(ctx context.Context, log *zap.Logger, s store.Storer, opt options.AuthO
|
||||
defClient *types.AuthClient
|
||||
)
|
||||
|
||||
log = log.Named("auth")
|
||||
log = log.Named("auth").WithOptions(zap.AddStacktrace(zap.PanicLevel))
|
||||
ctx = actionlog.RequestOriginToContext(ctx, actionlog.RequestOrigin_Auth)
|
||||
|
||||
svc = &service{
|
||||
opt: opt,
|
||||
log: log.WithOptions(zap.AddStacktrace(zap.PanicLevel)),
|
||||
log: log,
|
||||
store: s,
|
||||
settings: &settings.Settings{ /* all disabled by default. */ },
|
||||
}
|
||||
|
||||
@@ -68,6 +68,10 @@ func (au *authUser) Update(s *settings.Settings, u *types.User) {
|
||||
}
|
||||
|
||||
func (au *authUser) set(s *settings.Settings, u *types.User) {
|
||||
if u == nil || s == nil {
|
||||
return
|
||||
}
|
||||
|
||||
if u.Meta == nil {
|
||||
u.Meta = &types.UserMeta{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user