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

RestAPI: post method got Error with cors #8404

Closed
huynhquocmy opened this issue Oct 5, 2017 · 5 comments
Closed

RestAPI: post method got Error with cors #8404

huynhquocmy opened this issue Oct 5, 2017 · 5 comments

Comments

@huynhquocmy
Copy link

huynhquocmy commented Oct 5, 2017

When try with rest api: /api/v1/login POST method, I got this issue:

TypeError: Cannot read property 'authRequired' of undefined at Route.share.Route.Route._authAccepted 

(D:\huynh\Rocket.Chat\.meteor\local\build\programs\server\packages\nimble_restivus.js:403:17) at Route.share.Route.Route._callEndpoint 

Please help.

@MarcosSpessatto
Copy link
Member

Hey @huynhquocmy, do you still have this problem?

@huynhquocmy
Copy link
Author

@Marcos: Nope the issue still there. I was working around by turn off the security on the code ( API's side)

@huynhquocmy
Copy link
Author

huynhquocmy commented Jul 5, 2018

Here for more details: #7735 (comment)

@sampaiodiego
Copy link
Member

this might be a CORS issue..

@huynhquocmy you can change CORS values on Rocket.Chat from Administration panel > General:
image

@crowmw
Copy link

crowmw commented Aug 10, 2018

I have the same issue.
CORS values on Rocket.Chat changed to enabled and https://localhost:8080 (https because im using this address).

I always getting http 500 internal server error on /api/v1/login POST method

My request code from js app

axios
    .post(
      'https://rocketchat.app.com/api/v1/login',
      {
        username: 'valid_username',
        password: 'valid_password'
      },
      {
        headers: {
          'Content-Type': 'application/json;charset=UTF-8',
        }
      }
    )

RocketChat version: 0.64.1

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants