tinode / chat

Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reset password not working

young310 opened this issue · comments

Subject of the issue

  1. When you click the reset password, sometimes system will send you direct link to reset your password.
  2. But when you click on the submit button, system will prompt token not valid messages.
  3. After that, when you click on the reset password again, system will prompt send another recovery email with code.
  4. But I never received the email after the first one.

Your environment

Server-side

  • Your own setup:
    • platform: Ubuntu 22
    • version of Tinode server: 0.22
    • database backend: mysql
    • standalone

Client-side

  • TinodeWeb/tinodejs: javascript client
    • Chrome Version 112.0.5615.137 (Official Build) (arm64)

Steps to reproduce

  1. click on the password reset button and do the following.
  2. system will show invalid token, or

Screenshot 2023-05-06 at 15 43 02

4. never receive the email with security token.

Screenshot 2023-05-06 at 15 54 52

Expected behaviour

reset password successfully

Actual behaviour

stuck in the password resetting process.

Server-side log

I2023/05/06 15:46:15 Redirecting connections from HTTP at [:80] to HTTPS at [:6060]
I2023/05/06 15:46:15 Listening for client HTTPS connections on [:6060]
I2023/05/06 15:46:15 HTTP redirect failed: listen tcp :80: bind: permission denied
I2023/05/06 15:46:19 ws: session started UbAm4gvqQos 114.32.16.216:52378 1
I2023/05/06 15:46:19 in: '{"hi":{"id":"104269","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"fpGpZ-Ldeuj59qOwAPe5Nd:APA91bHNq3lggrWmIw9rB3zynFhtec2b3yUNBzxd9LLLMgqSitXfdkpwa8RwPf2M5SKY3TEsSxpGjy95immEAzMhvQPJ0b3RoZmrOIRigv0y-D3ysbjT0dQhLcLN8_Ae-AykeZDMNyMa","lang":"zh-TW","platf":"web"}}' sid='UbAm4gvqQos' uid=''
I2023/05/06 15:46:21 ws: session started _VWCvKkvTKw 114.32.16.216:52381 2
I2023/05/06 15:46:22 in: '{"hi":{"id":"77109","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"fpGpZ-Ldeuj59qOwAPe5Nd:APA91bHNq3lggrWmIw9rB3zynFhtec2b3yUNBzxd9LLLMgqSitXfdkpwa8RwPf2M5SKY3TEsSxpGjy95immEAzMhvQPJ0b3RoZmrOIRigv0y-D3ysbjT0dQhLcLN8_Ae-AykeZDMNyMa","lang":"zh-TW","platf":"web"}}' sid='_VWCvKkvTKw' uid=''
I2023/05/06 15:46:36 ws: session started UCQJk_rFsmI 114.32.16.216:52400 3
I2023/05/06 15:46:36 in: '{"hi":{"id":"111485","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"fpGpZ-Ldeuj59qOwAPe5Nd:APA91bHNq3lggrWmIw9rB3zynFhtec2b3yUNBzxd9LLLMgqSitXfdkpwa8RwPf2M5SKY3TEsSxpGjy95immEAzMhvQPJ0b3RoZmrOIRigv0y-D3ysbjT0dQhLcLN8_Ae-AykeZDMNyMa","lang":"zh-TW","platf":"web"}}' sid='UCQJk_rFsmI' uid=''
I2023/05/06 15:46:46 ws: session started D-gC29D4Fd8 114.32.16.216:52411 4
I2023/05/06 15:46:46 in: '{"hi":{"id":"68573","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"fpGpZ-Ldeuj59qOwAPe5Nd:APA91bHNq3lggrWmIw9rB3zynFhtec2b3yUNBzxd9LLLMgqSitXfdkpwa8RwPf2M5SKY3TEsSxpGjy95immEAzMhvQPJ0b3RoZmrOIRigv0y-D3ysbjT0dQhLcLN8_Ae-AykeZDMNyMa","lang":"zh-TW","platf":"web"}}' sid='D-gC29D4Fd8' uid=''
I2023/05/06 15:46:51 in: '{"login":{"id":"68574","scheme":"reset","secret":"YmFzaWM6ZW1haWw6dGl5YW5nMzEwQGdtYWlsLmNvbQ=="}}' sid='D-gC29D4Fd8' uid=''
I2023/05/06 15:47:40 in: '{"login":{"id":"104270","scheme":"reset","secret":"YmFzaWM6ZW1haWw6dGl5YW5nMzEwQGdtYWlsLmNvbQ=="}}' sid='UbAm4gvqQos' uid=''
I2023/05/06 15:53:39 ws: session started 5hXraSQfs2A 114.32.16.216:52901 4
I2023/05/06 15:53:39 in: '{"hi":{"id":"83173","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"fpGpZ-Ldeuj59qOwAPe5Nd:APA91bHNq3lggrWmIw9rB3zynFhtec2b3yUNBzxd9LLLMgqSitXfdkpwa8RwPf2M5SKY3TEsSxpGjy95immEAzMhvQPJ0b3RoZmrOIRigv0y-D3ysbjT0dQhLcLN8_Ae-AykeZDMNyMa","lang":"zh-TW","platf":"web"}}' sid='5hXraSQfs2A' uid=''
I2023/05/06 15:53:43 in: '{"login":{"id":"83174","scheme":"reset","secret":"YmFzaWM6ZW1haWw6dGl5YW5nMzEwQGdtYWlsLmNvbQ=="}}' sid='5hXraSQfs2A' uid=''

Client-side log

Running Ginger Widget v2.1.197
tinode.prod.js:1 [07:40:00.879] out: {"hi":{"id":"104268","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"<163, bytes: fpGpZ-Ldeuj5...-AykeZDMNyMa>","lang":"zh-TW","platf":"web"}}
tinode.prod.js:1 [07:40:01.094] in: {"ctrl":{"id":"104268","params":{"build":"mysql:v0.22.4","callTimeout":30,"iceServers":[{"urls":["stun:stun.oncall.com.tw"]},{"username":"young","credential":"l3831483","urls":["turn:turn.oncall.com.tw:80?transport=udp","turn:turn.oncall.com.tw:3478?transport=udp","turn:turn.oncall.com.tw:80?transport=tcp","turn:turn.oncall.com.tw:3478?transport=tcp","turns:turn.oncall.com.tw:443?transport=tcp","turns:turn.oncall.com.tw:5349?transport=tcp"]}],"maxFileUploadSize":52418800,"maxMessageSize":262144,"maxSubscriberCount":128,"maxTagCount":16,"maxTagLength":96,"minTagLength":2,"reqCred":{"auth":["email"]},"ver":"0.22"},"code":201,"text":"created","ts":"2023-05-06T07:40:00.918Z"}}
:6060/#reset?scheme=…ic&token=Njg4ODk2:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
tinode.prod.js:1 WebSocket connection to 'wss://.com:6060/v0/channels?apikey=AQAAAAABAACvHfpg88Ix6osHgaX8fyUC' failed:
(anonymous) @ tinode.prod.js:1
tinode.prod.js:1 WebSocket connection to 'wss://.com:6060/v0/channels?apikey=AQAAAAABAACvHfpg88Ix6osHgaX8fyUC' failed:
(anonymous) @ tinode.prod.js:1
tinode.prod.js:1 WebSocket connection to 'wss://.com:6060/v0/channels?apikey=AQAAAAABAACvHfpg88Ix6osHgaX8fyUC' failed:
(anonymous) @ tinode.prod.js:1
tinode.prod.js:1 WebSocket connection to 'wss://.com:6060/v0/channels?apikey=AQAAAAABAACvHfpg88Ix6osHgaX8fyUC' failed:
(anonymous) @ tinode.prod.js:1
tinode.prod.js:1 WebSocket connection to 'wss://.com:6060/v0/channels?apikey=AQAAAAABAACvHfpg88Ix6osHgaX8fyUC' failed:
(anonymous) @ tinode.prod.js:1
tinode.prod.js:1 [07:46:19.347] out: {"hi":{"id":"104269","ver":"0.22.2","ua":"TinodeWeb/0.22.2 (Chrome/112.0; MacIntel); tinodejs/0.22.2","dev":"<163, bytes: fpGpZ-Ldeuj5...-AykeZDMNyMa>","lang":"zh-TW","platf":"web"}}
tinode.prod.js:1 [07:46:19.652] in: {"ctrl":{"id":"104269","params":{"build":"mysql:v0.22.4","callTimeout":30,"iceServers":[{"urls":["stun:stun.oncall.com.tw"]},{"username":"young","credential":"l3831483","urls":["turn:turn.oncall.com.tw:80?transport=udp","turn:turn.oncall.com.tw:3478?transport=udp","turn:turn.oncall.com.tw:80?transport=tcp","turn:turn.oncall.com.tw:3478?transport=tcp","turns:turn.oncall.com.tw:443?transport=tcp","turns:turn.oncall.com.tw:5349?transport=tcp"]}],"maxFileUploadSize":52418800,"maxMessageSize":262144,"maxSubscriberCount":128,"maxTagCount":16,"maxTagLength":96,"minTagLength":2,"reqCred":{"auth":["email"]},"ver":"0.22"},"code":201,"text":"created","ts":"2023-05-06T07:46:19.411Z"}}
2content.js:46 Warning: a promise was rejected with a non-error: [object Undefined] at H (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1472239) at t._warn (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1466471) at F._rejectCallback (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1502081) at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1502334 at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1329987 at l (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1529718) at t._doInvokeOnCancel (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1461894) at c (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1456866) at s (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1456752) at a._drainQueues (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1457878) at drainQueues (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1456686)From previous event: at F.B [as _captureStackTrace] (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1471878) at F._resolveFromExecutor (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1502214) at new F (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1495291) at Object.start (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1329594) at r. (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1330840) at s.emit (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:1570716) at r.value (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:123740) at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:123406 at u (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:2221087) at Generator._invoke (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:2220875) at Generator.next (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:2221516) at a (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:34158) at s (chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:34361) at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:34420 at new Promise () at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:34301 at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:123497 at new Promise () at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:1:122959 at chrome-extension://mfidniedemcgceagapgdekdbmanojomk/content.js:46:2264080
s @ content.js:46
tinode.prod.js:1 [07:47:40.621] out: {"login":{"id":"104270","scheme":"reset","secret":"YmFzaWM6ZW1haWw6dGl5YW5nMzEwQGdtYWlsLmNvbQ=="}}
tinode.prod.js:1 [07:47:40.861] in: {"ctrl":{"id":"104270","code":409,"text":"duplicate credential","ts":"2023-05-06T07:47:40.683Z"}}
DevTools failed to load source map: Could not load content for chrome-extension://bmnlcjabgnpnenekpadlanbbkooimhnj/browser-polyfill.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
DevTools failed to load source map: Could not load content for https://.com:6060/umd/311.prod.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
DevTools failed to load source map: Could not load content for https://.com:6060/umd/501.prod.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

commented

Could you please post the password reset URL you are receiving. Thanks.

commented

scheme=basic&token=Njg4ODk2 is invalid. How did you generate it?

commented

Please share the auth_config section of your config file.

"auth_config": {
"logical_names": [],
"basic": {
"add_to_tags": true,
"min_login_length": 4,
"min_password_length": 6
},

            // Token authentication
            "token": {
                     "expire_in": 1209600,
                     "serial_num": 1,
                    "key": "**"
            },
            "code": {
                    "expire_in": 900,
                    "max_retries": 3,
                    "code_length": 6
            }

}

commented

I made a couple of fixes. If you can build it yourself, please do and verify. If not, wait for a few days. I have to fix another bug before making the 22.8 release.

Still not working, the newly similar link as follows.
https://.com:6060/#reset?scheme=basic&token=NzA0Mzg2
Screenshot 2023-05-10 at 12 22 56

I also tried a few new accounts (never registered before) and reset the password with no luck.
I only rebuild the webapp, anything do I also need to deal with?

p.s. UI bug
Screenshot 2023-05-10 at 11 54 55

commented

You did not update the server, did you?

no, it been a hard time to do server build.
I need to go certain version of Go SDK in order to make it success.

You did not update the server, did you?

commented

It's not going to work without the server update.

I build the server with build-all.sh, and test it.
Still not working with client message malformed(400)
and server message
I2023/05/12 02:21:37 in: '{"acc":{"id":"88956","scheme":"basic","secret":"OmwzODMxNDgz","tmpscheme":"token","tmpsecret":"NjcwMzU4"}}' sid='wHFxJPrOs00' uid=''
W2023/05/12 02:21:37 s.acc: invalid temp auth malformed wHFxJPrOs00

It's not going to work without the server update.

commented

It does not look like you are running an updated server. Your "tmpsecret":"NjcwMzU4" is too short, which is consistent with the server which has not been updated.

I build with clean environment and confirm the bug has fixed, thanks.

Btw, is there any way to downgrade database version? e.g. 114 -> 113

@or-else tindroid has similar problems, ask for verify code, any suggestion?

commented

It should work on all platforms now.

commented

No update in a week. I assume all is fine.