Closed Bartozzz closed 7 years ago
Hi @Bartozzz,
I am not able to spot something particularly wrong with your code, so I can just try to guess.
First, for
Note that the cookies and the session are not available here in the ctx even if passReqToCallback is set to true.
Maybe #89 issue provides you with an intermediate solution (https://github.com/rkusa/koa-passport/issues/89#issuecomment-284972922) until this issue is finally integrate into koa-passport
somehow.
My guess for the actual problem would be that the steam authentication provider ignores Set-Cookie
and simply does not provide you with a Cookie
header for the callback. Could this be the reason?
I am trying to save persistent data in order to send it back to user once the authorization has succeeded. I am trying to achieve this using sessions (
koa-session
), cookies (implemented by default inKoa.js
) and inPassport.js
state. None of those works.I am not sure though, if it is a problem with
koa-passport
orpassport
itself. It looks like one of those modules is blocking cookies/sessions at one point.Cookies are set in (A) (and they are available there even in subsequent requests). However, those are
undefined
in (B).Server configuration/middlewares:
Strategy:
Note that the cookies and the session are not available here in the
ctx
even ifpassReqToCallback
is set totrue
.ctx.state
also doesn't containctx.query.connectionID
(see routes below).Routes:
When I am requesting
/api/auth/steam
(A) it outputsn+1
andm+1
correctly, so cookies and sessions are set. However, those areundefined
inreturnURL
(B).I am not sure if
passport
is regenerating sessions/refreshing cookies or something in thereturnURL
(B), but it should not be the case as I've disabled sessions by myself ({ session: false }
). Any thought why thosecookies
/sessions
/states
are not avaible in another route (returnURL
)?