mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Fix error checks in provisioning API login
This commit is contained in:
parent
1583ccd013
commit
1a6fdf565e
1 changed files with 4 additions and 4 deletions
|
@ -362,13 +362,13 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) {
|
||||||
qrChan <- "stop"
|
qrChan <- "stop"
|
||||||
if err != nil {
|
if err != nil {
|
||||||
var msg string
|
var msg string
|
||||||
if err == whatsapp.ErrAlreadyLoggedIn {
|
if errors.Is(err, whatsapp.ErrAlreadyLoggedIn) {
|
||||||
msg = "You're already logged in"
|
msg = "You're already logged in"
|
||||||
} else if err == whatsapp.ErrLoginInProgress {
|
} else if errors.Is(err, whatsapp.ErrLoginInProgress) {
|
||||||
msg = "You have a login in progress already."
|
msg = "You have a login in progress already."
|
||||||
} else if err == whatsapp.ErrLoginTimedOut {
|
} else if errors.Is(err, whatsapp.ErrLoginTimedOut) {
|
||||||
msg = "QR code scan timed out. Please try again."
|
msg = "QR code scan timed out. Please try again."
|
||||||
} else if err == whatsapp.ErrInvalidWebsocket {
|
} else if errors.Is(err, whatsapp.ErrInvalidWebsocket) {
|
||||||
msg = "WhatsApp connection error. Please try again."
|
msg = "WhatsApp connection error. Please try again."
|
||||||
user.Disconnect()
|
user.Disconnect()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue