Hi sorry if this is stupid question, Im new to auth, is it normal for the refreshtoken not being sto...
u
Hi sorry if this is stupid question, Im new to auth, is it normal for the refreshtoken not being stored in the Storage? My frontend sdk is set up based on the docs however so far I only see sAccessToken. my backend has the logs that it was all set up though
Copy code
2024-02-21 01:09:25 [DEBUG] [cookie_and_header] - {"t": "2024-02-20T17:09:25.666Z", "sdkVer": "0.17.0", "message": "Setting access token as cookie", "file": "recipe/session/cookie_and_header.py:267"}
com.supertokens {"t": "2024-02-20T17:09:25.666Z", "sdkVer": "0.17.0", "message": "Setting refresh token as cookie", "file": "recipe/session/cookie_and_header.py:267"}

2024-02-21 01:09:25 [DEBUG] [cookie_and_header] - {"t": "2024-02-20T17:09:25.666Z", "sdkVer": "0.17.0", "message": "Setting refresh token as cookie", "file": "recipe/session/cookie_and_header.py:267"}
2024-02-21 01:09:25 [INFO] [_internal] - 127.0.0.1 - - [21/Feb/2024 01:09:25] "POST /auth/signin HTTP/1.1" 200 -
r
hey @1wei_ it is stored in the cookie store just like the access token, but chrome doesn't show it unless you visit the /auth/session/refresh path. Just a chrome UI thing
u
Hihi I checked on the postman and yep its there. Just wondering why there is 2 refreshtoken with one false httponly
r
thats unexpected.
the path of the one that has
/
is not set by us. So not sure how that ended up in postman
u
Ohh hmm i have a pressing issue is that The cookies werent attached on the headers -> do i need to do it manually? Also my backend verify session cannot detect my session in the frontend even though my browser had accesstoken stored
So what may be the problem? Other than setting session.init() is there any other thing i need to do to set up the session on frontend? I already have sign in and out which add token and remove token
Im using react and use supertoken web js for custom ui
r
you dont have to add tokens manually
what are the response headers from the sign in API? (please show screenshot as seen on chrome)
u
and the refresh token the problem is verify_session does not receive any cookies i have verify session under one of my api (/cafe) so when this particular api is called, it keeps showing unauthorised
r
what is the request headers for the API you are calling that returns a 401?
u
here is the header, it doesnt have the cookie.
so i was wondering do I need to manually add it?
the sdk should intercept right but it seems like its not
i put this in my index.js
Copy code
SuperTokens.init({
  appInfo: {
    apiDomain: "http://localhost:5000",
    apiBasePath: "/auth",
    appName: "My Web API",
    websiteDomain: "http://localhost:3000"
  },
  recipeList: [EmailPassword.init(), Session.init()]
});
r
whats the URL you are querying in the above screenshot? Is it http://localhost:5000?
u
I realise 127.0.0.1 is different from localhost thanks a lot! I fixed my teams' env and it works now.