Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFrame login checks for presence of "token" value, while documentation says "loginToken" is enough #8145

Closed
astax-t opened this issue Sep 14, 2017 · 0 comments

Comments

@astax-t
Copy link
Contributor

astax-t commented Sep 14, 2017

Description:

When using iframe login, the client code checks for presence of "token" value in the response ( https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-iframe-login/iframe_client.js#L69 ). But the documentation at https://rocket.chat/docs/developer-guides/iframe-integration/authentication/ says :

Or you can respond with native account token using loginToken:

{
  "loginToken":"your-auth-token"
}

The workaround is simple - the response needs to include both properties, but it takes time to figure out what's the problem. Either the code or documentation needs to be fixed.

Server Setup Information:

  • Version of Rocket.Chat Server: 0.58.2
  • Operating System: Ubuntu 16.04 LTS
  • Deployment Method(snap/docker/tar/etc): snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • Node Version:

Steps to Reproduce:

  1. Enable and configure iframe integration as described in documentation, using "loginToken" only in the response
  2. Open Rocket.Chat in browser and monitor network data in dev tools
  3. Note the network requests in browser dev tools

Expected behavior:

Apart from Rocket.Chat resources, one request to login API URL

Actual behavior:

One request to API URL. Then another request to iframe URL.

Relevant logs:

astax-t pushed a commit to astax-t/Rocket.Chat that referenced this issue Sep 14, 2017
rodrigok added a commit that referenced this issue Sep 18, 2017
[FIX] Fix iframe login API response (issue #8145)
rodrigok added a commit that referenced this issue Sep 18, 2017
[FIX] Fix iframe login API response (issue #8145)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant