api/account redirect to login even after login jhi

2019-08-23 06:22发布

问题:

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)

标签: jhipster