interact: fix auth

This commit is contained in:
c9s 2022-04-17 12:46:08 +08:00
parent 41c78f9035
commit b2e17e3552

View File

@ -83,12 +83,14 @@ func (it *AuthInteract) Commands(interact *Interact) {
return ErrAuthenticationFailed return ErrAuthenticationFailed
}) })
} else { } else {
interact.Command("/auth", "authorize", func(reply Reply) error { interact.Command("/auth", "authorize", func(reply Reply, session Session) error {
switch it.Mode { switch it.Mode {
case AuthModeToken: case AuthModeToken:
session.SetAuthorizing(true)
reply.Message("Enter your authentication token") reply.Message("Enter your authentication token")
case AuthModeOTP: case AuthModeOTP:
session.SetAuthorizing(true)
reply.Message("Enter your one-time password") reply.Message("Enter your one-time password")
default: default: