How to change URLWithLinkCode in the frontend part...
# support-questions
s
How to change URLWithLinkCode in the frontend part? Here, ia my code. I want to modifie it and send it to user's mail.
r
How to change URLWithLinkCode in the frontend part? Here, ia my code. I want to modifie it and send it to user's mail.
Hey
How do you want to modify it?
s
I want to remove some parameter like rid=passwordless, and add parameter linkcode
this is real one.
rather than sending id as parameter, i want to send it as routes
r
Ah ok. You can modify it on the backend function where you send the email
But if you are changing the path of th url, then you will have to handle that on the frontend yourself
s
but how?
r
Using js
s
ya! i am managing it with custom ui
so i am asking
r
I mean u have the urlWithLinkCode In that function. It’s a string. U can manipulate it however you like
s
ok. got it.
how to manage session for passwordless recipe?
any docs or?
r
There is a session section in the passwordless docs. In common customisation.
s
ok.
should i use JWT for session or other is available?
r
Try to avoid JWT for sessions
The default should work
s
so, when i loggin it instantly logouts
r
Can you enable debug logging and make the call to login?
s
and makes request it shows like this
r
And show me the output
It’s probably some misconfiguration from your end
s
login done successfully
i am building custome ui
r
Can you enable debug logging and show me the output? From the backend SDK
s
sure.
what exactly you need to see in backend? bcz i think i don't have any output for backend
as i told you yesterday i have copied both files of backend
r
I want to see the output logs when u call the api
So that I can help you debug the session issue
s
I think i have to edit the session.init(). AM i right?
r
You shouldn’t need to. By default it figures out the right settings
Again, if you can enable debug logs on the backend and show me, I can help 🙂
Otherwise it’s difficult to know what’s wrong
s
ya! showing you.
simply, I am making request here and getting the output which i sent you.
r
You haven’t enabled debug logging
See the trouble shooting section in the docs
s
i am not able to undestand!
bcz i can't see anything where i am making request in my index.js file
r
Please see the troubleshooting section in the docs
That will show you how to enable debug logging
s
ya! got it
r
Then you can make a request to the /sessioninfo and see why it’s returning 401
s
ok.
where i have to set this?
SET DEBUG=com.supertokens
r
Terminal
Run that command on the terminal
s
it's giving error
r
Are you using windows?
s
yes
is there any other way?
r
How to set env var in windows?
s
using .env file
r
Yea. You can use .env file too
s
ok.
r
In that, ass DEBUG=com.supertokens
s
is it correct?
r
Without the set
And put the com.supertokens I’m quotes
In*
s
now, is hould run?
*should
r
Yea. True
Try*
What version of the SDK are you using?
s
latest
r
Not sure. You need to figure how to set this env var on windows
s
let me do it.
r
Just try “DEBUG=com.supertokens node index.js”
s
it's working
r
Ok great. Now let’s see the logs
Can you paste all the logs and share it in a file?
So in postman, it seems that your access token has expired. Did you login a long time ago?
Or just now? (In postman)
s
before 25 mintues
r
Yea. So call the login API again in postman and see if the endpoint works
s
what is the expiry time? I also want to change it.
ok.
r
1 hour expiry time.
Alternatively, you can refresh the session by calling the refresh api
s
how to do that?
r
See the section in testing -> with postman (in docs)
s
so, Basically i have loggedin using frontend part and checking about session using postman. so, it matters?
or both thing i should do from postman only or frontend only
r
You need to call the login api in postman too
I mean the browser session is different from postman session.. they are different clients
s
oh! got it!
r
You can’t login to the browser and expect a session in postman to work.
(And vice versa)
s
let me check if my postman is fine than bbrowser is also fine
login successful
got it man!
thank you so much! you are helping me from last 2 days.
2 Views