Rocket Chat Issues - Unexpected token

I recently installed a SSL for my entire site (not just Chat) and it seems that now after going to HTTPS, if you try to enter the chat room, click the connect button, it doesn't do anything.

I reviewed the chat_log and I see this everywhere:

 

"line":"431","file":"oauth.js","message":"Error in OAuth Server: Unexpected token <","time":{"$date":1535380819675},"level":"warn"}

Exception while invoking method 'login' SyntaxError: Unexpected token 

Is there a way to clear out the old tokens, do I need to update something, not sure what (if anything) I can do about the OAuth2 server? 

Note: If you never actually sign out of the Chat, it will continue to work. Once you sign out, you cannot get back in. 

  • 1389
  • More
Replies (8)
    • You need to generate new key&secret pair for new domain in UNA OAuth2 module and use them in Rocket.Chat, also make sure to change URL of UNA in Rocket.Chat settings as well.

      • Hey Alex T⚜️ - The domain for Rocket Chat has always been like this - https://chat.mysite.com - and that has never changed. Should I still generate new keys?

        • I thought that you've added https on both UNA and Rocket.Chat. 

          If you changed only UNA URL and Rocket.Chat URL is the same - then in this case go to Rocket.Chat setting and make sure that there is correct UNA URL there.

          • No. I only added https on my main website. Rocket.Chat is installed on a sub-domain as mentioned above. The settings are still the same as they were. Rocket.Chat has the same URL in the settings as it always has. 

            It seems that these 'tokens' are storing when the site was back in http mode. Is there no way to clear the tokens and start fresh so it picks up the https:// instead?

            • Could it be the tokens in the `bx_oauth_access_tokens`  or maybe the `bx_oauth_refresh_tokens` - They both seem to have the same number of records.

              • Did you changed URL of you main website in Rocket.Chat server settings ?

                • I was able to resolve my issue with the guidence of Alex T⚜️  Here is what I had to do. Since my site recently went to https, there is a setting inside Rocket Chat itself that needed to be change. Luckily, I never logged out completely of the chat. If you do, I am not sure how you could get to these settings. Here is what I did:

                  Went into to the Administration area of Rocket Chat > Scrolled down to where it says OAuth (under Meta) > There is a p-lace where your site URL is put. I had to change this to reflect https:// and click Save Changes. Afterwards, scroll a little below where the URL is and clicked Refresh OAuth Services. Everything started working after these changes. 

                  See attachments RC1, RC2, RC3

                  aifbjavraq6ht86unzedkmncupbxf8fx.pngdb78s6fjsyu5m4lpbdcpwprw7zrm8rhf.png

                  mss2sbjybdva5628keze9xhlufywuwhy.png

                  • I was logged out so how do I get back in to refresh OAuth servers?

                    Login or Join to comment.