From c8ffd921d42bbb509cba7940aac5535228f42883 Mon Sep 17 00:00:00 2001 From: yoyinzyc Date: Mon, 2 Dec 2019 14:09:07 -0800 Subject: [PATCH] auth: fix user.Options nil pointer --- auth/store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/store.go b/auth/store.go index 52122554a..c4d24a99c 100644 --- a/auth/store.go +++ b/auth/store.go @@ -306,7 +306,7 @@ func (as *authStore) Authenticate(ctx context.Context, username, password string return nil, ErrAuthFailed } - if user.Options.NoPassword { + if user.Options != nil && user.Options.NoPassword { return nil, ErrAuthFailed } @@ -344,7 +344,7 @@ func (as *authStore) CheckPassword(username, password string) (uint64, error) { return 0, ErrAuthFailed } - if user.Options.NoPassword { + if user.Options != nil && user.Options.NoPassword { return 0, ErrAuthFailed }