Hi, can I set the expire duration for access and r...
# support-questions-legacy
a
Hi, can I set the expire duration for access and refresh token? I want to set a short time for dev demo purpose
r
hey @anas
a
perfect!
one more question
I searched the the doc and api references too
I get this error when I verify session: {"type":"UNAUTHORISED","payload":{"clearTokens":false},"errMagic":"ndskajfasndlfkj435234krjdsa","fromRecipe":"session"}
I don't know why
I send the access token too
r
can you enable backend debug logs and show the output?
a
how?
r
see our docs - debugging section
a
I wonder if it is because I send the tokens in header contrary to cookie
r
what is the output when the api is called?
a
Copy code
{
  "type": "UNAUTHORISED",
  "payload": {
    "clearTokens": false
  },
  "errMagic": "ndskajfasndlfkj435234krjdsa",
  "fromRecipe": "session"
}
the other is stacktrace
r
well, the backend logs will show why it's unauthoorised
so you need to show me all the logs
a
this is from line 45
r
oh yea, but the debug logs show you why the erorr is thrown
can u show me all the logs?
a
sorry that is all the logs
message: "getSession: UNAUTHORISED because accessToken in request is undefined"
headers log in the backend
r
hmm.
a
I followed the doc I think
r
Can you try with a capital A for authorization?
a
ok
r
also, can i see all the request headers?
a
from line 42
r
im not sure why the function can't get the auth header. What framework are you using? How are you sending the request?
a
Frontend: React Native (web for now), TRPC Backend: Next.js
r
how is the request being sent?
a
this is the line that makes the request
and here we add the auth headers
it uses
fetch
behind the scene
btw
this is backend config:
r
well, the only explanation is that it's not actually setting the auth header in the request correctly.
So you might want to inspect the client code that sends requests
37 Views