I can’t seem to get the cookie to set no matter wh...
# talk-kratos
w
I can’t seem to get the cookie to set no matter what I try. Even though I am running Kratos in
development
mode, it seems to set
SameSite=Lax
- is this expected? The browser’s
set-cookie
says cookie blocked
because it had the "SameSite=Lax" attribute but came from a cross-site response which was not the response to a top-level navigation
.
d
Hello. Could you please share more information about your case? What domains do you use for authentication flow? Do you use Kratos in your local development environment, or do you try to configure it in a staging/production environment?
w
Hi, so this error seems have occurred because I had my UI in localhost but I was using a production deployment of Kratos in my kubernetes cluster. So for development purposes, I’m using localhost for both UI and Kratos now and that seems to have solved this problem.
BUT
I’m running into another issue
After doing a POST on
/self-service/registration/flows?id=XXX
, it shows 422 with a
redirect_browser_to
, which I use to redirect the page. I see the
Set-Cookie: ory_kratos_continuity=XXX
here
Then I see 302 on
<https://github.com/login/oauth/authorize?client_id=0d12569c0aee6c6fbb9d&redirect_u[…]%3Auser+user%3Aemail&state=dca086dc-7638-48a2-8e67-d1187b466892>
and then 302 on
<http://127.0.0.1:4433/self-service/methods/oidc/callback/github?code=c34f199debb215031484&state=dca086dc-7638-48a2-8e67-d1187b466892>
But I don’t see the consent screen
And then I’m at 400
session already available
which redirects me to
/
but I’m not sure where I can get the
identity
information
In registration page:
Copy code
const handleSubmit = async (values) => {
    console.log('values', values)
    try {
      const { data } = await axios({
        method: flow.ui.method,
        url: flow.ui.action,
        headers: {
          Accept: 'application/json',
        },
        data: values
      })

      // If we ended up here, it means we are successfully signed up!
      console.log('User session: ', data, data.identity)

      // For now however we just want to redirect home!
      return navigate(flow.return_to || '/')
    } catch (err) {
      handleFlowError(err, navigate, 'registration', setFlow)
    }
  }
My
handleSubmit
never gets to the
data.identity
part because it always errors out with 422 for redirect to github
Hi - I resolved the issue by calling the
/sessions/whoami
endpoint
🙌 1