Commit c4b2937c authored by Eric's avatar Eric

[Bugfix] fix panic error when user does not exist.

parent 42917447
......@@ -38,7 +38,7 @@ func checkAuth(ctx ssh.Context, password, publicKey string) (res ssh.AuthResult)
logger.Infof("%s %s for %s from %s", action, authMethod, username, remoteAddr)
return
}
if resp != nil {
if resp != nil && resp.User != nil {
switch resp.User.OTPLevel {
case 0:
res = ssh.AuthSuccessful
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment