diff --git a/provisioning.go b/provisioning.go index e532079..d99b4a9 100644 --- a/provisioning.go +++ b/provisioning.go @@ -619,6 +619,11 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) { return nil }) + if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" { + user.Timezone = userTimezone + user.Update() + } + qrChan, err := user.Login(ctx) if err != nil { user.log.Errorln("Failed to log in from provisioning API:", err) @@ -652,11 +657,6 @@ func (prov *ProvisioningAPI) Login(w http.ResponseWriter, r *http.Request) { "phone": fmt.Sprintf("+%s", jid.User), "platform": user.Client.Store.Platform, }) - - if userTimezone := r.URL.Query().Get("tz"); userTimezone != "" { - user.Timezone = userTimezone - user.Update() - } case whatsmeow.QRChannelTimeout.Event: user.log.Debugln("Login via provisioning API timed out") errCode := "login timed out"