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

Client error: POST https://account.mymagic.my/oauth/token resulted in a 400 Bad Request response #6

Open
exiang opened this issue Apr 14, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@exiang
Copy link
Contributor

exiang commented Apr 14, 2020

Screenshot 2020-04-14 at 10 04 03 PM

To reproduce:

  1. Login cpanel at https://square.sarawak.digital/cpanel
  2. Click Avatar
  3. Click Setting
@exiang exiang added the bug Something isn't working label Apr 14, 2020
@exiang
Copy link
Contributor Author

exiang commented Apr 14, 2020

seems like $_COOKIE['x-token-access'], $_COOKIE['x-token-refresh'] is empty in CpanelController \ actionProfile

@gtaclub
Copy link

gtaclub commented Apr 14, 2020

Yeap correct it's cookie issue. Wrapper not creating cookie for the authentication. Can trace once the site goes online. Now I am facing DNS_PROBE_FINISHED_NXDOMAIN error.

@exiang
Copy link
Contributor Author

exiang commented Apr 15, 2020

@gtaclub wrapper hardcoded into cookie specific to .mymagic.my domain is believe to cause this issue. We cannot assume all site using wrapper is specific to .mymagic.my domains

setcookie('x-token-access', json_decode((string) $response->getBody(), true)['access_token'], time() + (86400 * 30), '/', '.mymagic.my');
setcookie('x-token-refresh', json_decode((string) $response->getBody(), true)['refresh_token'], time() + (86400 * 30), '/', '.mymagic.my');

@gtaclub
Copy link

gtaclub commented Apr 15, 2020

@exiang Yeap, need to add that in config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants