3
0

Reconfigure log & make auth more robust

This commit is contained in:
Denis Arh
2021-04-02 11:38:28 +02:00
parent d52b2a94cc
commit f16bd31109
2 changed files with 6 additions and 2 deletions

View File

@@ -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. */ },
}

View File

@@ -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{}
}