-
Notifications
You must be signed in to change notification settings - Fork 118
jwt cookie is not set after the correct authentication #514
Comments
While using the feather's client, I've got authentication returning a token and even storing the token in localStorage, but it doesn't set the cookie. Thus subsequent redirects won't be authenticated. I've looked at trying to have middleware set the cookie after the auth service authenticates but I don't think that works anymore, and I don't want to expose cookies to all my hooks, I just would like the authentication after hook to set the |
It's worth noting too, that |
Well, for my issue I think Excerpt from debugging session debugCode changes in
And output:
Edit - I commented out the clearCookie and the cookies just aren't being set at all... So the headers are set but in chrome the cookies aren't persisting. Pretty sure I'm not in incognito or anything - so weird! |
I set up a protected route as outlined in docs.feathersjs.com/guides/auth/recipe.express-middleware.html, and am experiencing the same lack of cookie storage. Auth flow with |
I am also seeing duplicate Set-Cookie headers. One is empty, so is it possible that this is interfering with the cookie that is set? Chrome doesn't show a cookie in Application -> Cookies. Version info:
Cookie headers:
Edit: It looks like this extra header is getting set here: https://github.com/feathersjs/authentication/blame/master/lib/express/set-cookie.js#L33 |
I experienced the same problem.
I switched to axios and the cookie was saved without any problems.
|
Same here. Two Set-Cookie headers. One is normal and one is empty. |
Did anyone discover any workarounds in the meantime? |
I am experiencing this issue too. Seems like feathers are phasing out cookies altogether though. feathersjs/feathers#1045. @rxb |
I had a similar issue: cookie for feathers-jwt was in the Header (even 2 of it: one is perhaps set to clear the other - see @feathers/authentication/lib/express/set-cookie), and none was stored in the browser on production ... But it was working for me ... on dev server only ! Finaly i found the problem came from cookie's domain (to be precise: subdomain) set by feathers/auth On dev server everything was fine because node and front server was sharing the exact same domain: But in production subdomains were differents: @feathers/authentication may have set the cookie's domain to My theory is that app.domain.com was then not allowed by the browser to store it. Anyway, after trying different workarounds if found the simplest ... that is not documented in feathers doc : Add a
|
oAuth has been changed significantly in Feathers v4 authentication and does no loner use cookies to transmit the token. Please see the migration guide for more information. Closing this issue in order to archive this repository. Related issues can be opened at the new code location in the Feathers main repository. |
Steps to reproduce
https://github.com/PavelPolyakov/feathers-authentication-cookie-bug
The reproduction repo is based on the simple generated app. The only thing to highlight is that I've packed https://github.com/feathersjs/feathers-authentication-client and put it as
auth.bundle.js
, as it's not possible to include it from the CDN.In order to reproduce:
feathers-jwt
cookieExpected behavior
It is stated in the documentation:
https://docs.feathersjs.com/api/authentication/server.html#default-options
That in case we enable
cookie
, then the appropriate cookie would be set after the successful authentication.Actual behavior
The cookie is not there.
System configuration
nothing special
Module versions (especially the part that's not working):
feathers-client 2.2.0
feathers-authentication-client 0.3.2
NodeJS version:
v6.3.1
Operating System:
Mac OS
Browser Version:
latest Chrome
React Native Version:
Module Loader:
Please, let me know if it's a bug. Seems that the same behaviour is mentioned here: #389 , however, there the main topic is
react native
.Regards,
The text was updated successfully, but these errors were encountered: