https://supertokens.com/ logo
#general
Title
# general
s

santhosh

05/19/2022, 11:55 AM
Hi all, I follow this blog to have the custom ui with super token. https://supertokens.com/blog/adding-social-login-to-your-website-with-supertokens But the the token is not saved in cookies. After the signinup call. Can any one give the working example. Thanks
r

rp

05/19/2022, 12:01 PM
hey @santhosh
Can you enable debug logs on the backend and frontend and show me all of them when you make the signinup API call?
s

santhosh

05/19/2022, 12:09 PM
Actually using the supertoken UI. It's sets up the access token in cookies. But using custom UI without using super token UI. It's not setting.
Just i had one button for Google sign-in. Then I followed step 1 and step2.
Both steps are successful. But access token is not saved in cookies
r

rp

05/19/2022, 12:13 PM
are you using axios?
s

santhosh

05/19/2022, 12:13 PM
No
r

rp

05/19/2022, 12:13 PM
if yes, rememebr to add the axios interceptors
then you will need to enable logging and show me the logs
only then i can help
s

santhosh

05/19/2022, 12:36 PM
I changed to axios. I did use interceptors for request and response.
Same issue.
You were asking for the log
r

rp

05/19/2022, 12:36 PM
can you please enable debug logs and show me the output?
it will be easier
s

santhosh

05/19/2022, 2:17 PM
Hey @rp I have added withCredentials as true in axios.create
It's working fine now
r

rp

05/19/2022, 2:17 PM
i see. okay! that should have been added on it's on if the interceptor was being applied
so if you had to add it, it probably means that the interceptor was not being applied
s

santhosh

05/19/2022, 2:18 PM
Yes
Google login working fine. But apple login throwing issue
Error: token used before issued Status: field_error
r

rp

05/19/2022, 2:19 PM
Apple is sending that resposne
s

santhosh

05/19/2022, 2:20 PM
This error coming while using signinup
Oh
Actually we use default supertoken credentials in backend
For the apple account
r

rp

05/19/2022, 2:21 PM
are you using golang?
s

santhosh

05/19/2022, 2:21 PM
Yes
where are you running the golang server?
on your local machine?
s

santhosh

05/19/2022, 2:23 PM
Local
r

rp

05/19/2022, 2:23 PM
are you sure you have no clock skew issue on your local machine?
the time on your local machine is correct?
s

santhosh

05/19/2022, 2:50 PM
May be 30 sec plus or minus
Will that affect as well
r

rp

05/19/2022, 2:50 PM
That is a BIG skew.
that would definitely cause all sorts of issues
s

santhosh

05/19/2022, 3:27 PM
Now it's working good after changing to rite time
But google sign-in working fine with 30 sec delay
Why it's not working for apple
r

rp

05/19/2022, 3:29 PM
cause with google sign in, we don't use the ID token they send and instead query them diectly using their access token
with apple sign in, we use their ID token directly to extract user info. The ID token is a JWT which is verified before use
since your time was 30 seconds off, the verification of the JWT failed
which threw this error
s

santhosh

05/19/2022, 3:32 PM
Ok
Thanks for your expertise here. It really helps.
r

rp

05/19/2022, 3:35 PM
happy to help πŸ™‚
s

santhosh

05/19/2022, 3:35 PM
One more question related to ui.
r

rp

05/19/2022, 3:36 PM
Sure
s

santhosh

05/19/2022, 3:37 PM
After the signinup and verify call. How to remove the auth/callback/apple in the URL. Just it should load localhost:3000
r

rp

05/19/2022, 3:41 PM
i don't understand your question
s

santhosh

05/19/2022, 4:38 PM
After the url redirection from sign in, code will be to the browser url.
r

rp

05/19/2022, 4:38 PM
yup
from the auth provider or from the page within the app that calls /signinup?
s

santhosh

05/19/2022, 4:39 PM
Signinup
r

rp

05/19/2022, 4:39 PM
that should not happen
s

santhosh

05/19/2022, 4:39 PM
After this call we ll call verify
r

rp

05/19/2022, 4:40 PM
or maybe i still don't understand your quesiton
s

santhosh

05/19/2022, 4:40 PM
Actually i check the supertoken demo app. Once after Google sign-in, application with redirect to web app url with code
Using the code signinup API with ll be called
After that browser removed the excess path with code
It ll be having only localhost:3000
r

rp

05/19/2022, 4:44 PM
yea..
s

santhosh

05/19/2022, 4:45 PM
My question is how to do remove the excess path and just load localhost:3000
r

rp

05/19/2022, 4:53 PM
That’s just a regular browser redirect
You can google that πŸ˜…
s

santhosh

05/19/2022, 4:55 PM
Ya i got it way before. Since I asked you before. I explained it. πŸ˜‚
Cool