Unverified Commit a4cfa7c4 authored by Eric_Lee's avatar Eric_Lee Committed by GitHub

Merge pull request #155 from jumpserver/dev_bugfix

[Bugfix] fix panic error when user does not exist.
parents 42917447 c4b2937c
...@@ -38,7 +38,7 @@ func checkAuth(ctx ssh.Context, password, publicKey string) (res ssh.AuthResult) ...@@ -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) logger.Infof("%s %s for %s from %s", action, authMethod, username, remoteAddr)
return return
} }
if resp != nil { if resp != nil && resp.User != nil {
switch resp.User.OTPLevel { switch resp.User.OTPLevel {
case 0: case 0:
res = ssh.AuthSuccessful 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