api/account redirect to login even after login jhipster

混江龙づ霸主 提交于 2020-01-16 20:07:17

问题


when i hit api/authentication jhispter found user and print but when i hit api/account then it print anonymous user.

we have jhipster angular application up and running perfectly without any issue but we want to add react native application with jhipster backend. we are getting the issue on authentication and API/account API after successful login when I hit API/account or any custom API/** it failed because jhipster considers react-native user anonymous user.

why jhipster considers an anonymous user to every application except angular one.

I am facing this issue when I am trying to add another front-end app. currently generated jhipster application working except not working.

Request URL: localhost:8080/api/account

Request Method: GET

Status Code: 302 Found

Remote Address: [::1]:8080

Referrer Policy: no-referrer-when-downgra

Response Headers

Access-Control-Allow-Credentials: true

Access-Control-Allow-Origin: localhost:8081

Cache-Control: no-cache, no-store, max-age=0, must-revalidate

Connection: keep-alive

Content-Length: 0

Date: Fri, 19 Jul 2019 10:29:44 GMT

Expires: 0

Location: localhost:8080/login

Pragma: no-cache

Vary: Origin

X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block

(https://user-images.githubusercontent.com/14179110/61437914-9d6e2100-a957-11e9-9bd3-854e7d7dbcc8.png)

来源:https://stackoverflow.com/questions/57106835/api-account-redirect-to-login-even-after-login-jhipster

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!