Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
Update web_login.go
Browse files Browse the repository at this point in the history
  • Loading branch information
lyc8503 authored Jan 28, 2023
1 parent ff60f05 commit 81319fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/web_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
utls "github.com/refraction-networking/utls"
)

var ERR_NEXT_AUTH_SMS = errors.New("SMS Code required.")
var ERR_NEXT_AUTH_TOTP = errors.New("Current usee's TOTP is binded.")
var ERR_NEXT_AUTH_SMS = errors.New("SMS Code required")
var ERR_NEXT_AUTH_TOTP = errors.New("Current user's TOTP bound")

func WebLogin(server string, username string, password string) (string, error) {
server = "https://" + server
Expand Down Expand Up @@ -140,7 +140,7 @@ func WebLogin(server string, username string, password string) (string, error) {
}

// TOTP Authnication Process (Edited by JHong)
if strings.Contains(string(buf[:n]), "<NextService>auth/token</NextService>") || strings.Contains(string(buf[:n]), "<NextServiceSubType>totp</NextServiceSubType>") || strings.Contains(string(buf[:n]), "<NextAuth>2</NextAuth>") {
if strings.Contains(string(buf[:n]), "<NextService>auth/token</NextService>") || strings.Contains(string(buf[:n]), "<NextServiceSubType>totp</NextServiceSubType>") {
log.Print("TOTP Authnication required.")
return twfId, ERR_NEXT_AUTH_TOTP
}
Expand Down

0 comments on commit 81319fd

Please sign in to comment.