https://supertokens.com/ logo
#support-questions
Title
# support-questions
b

Bruno Diferente

06/14/2022, 10:24 AM
Hello everyone, I'm currently reworking React Supertokens
auth
pages implementing custom design and pages that use APIs directly with
axios
, I'm having issue with
sIRFrontend
cookie, when its valued changed to remove it will never change even if i have successful
login / register
, however if I use
fetch
everything works just fine.
n

nkshah2

06/14/2022, 10:24 AM
Hi @Bruno Diferente,
Are you adding the SuperTokens interceptor to your axios instance?
b

Bruno Diferente

06/14/2022, 10:25 AM
Hello @nkshah2, How are you doing ?
No not really
n

nkshah2

06/14/2022, 10:25 AM
What recipe are you using?
b

Bruno Diferente

06/14/2022, 10:26 AM
Email and password, but my fellow added thirdparty login without changing the recipe 😄
b

Bruno Diferente

06/14/2022, 10:26 AM
Ah it is indeed
Thirdpartyemailpassword
import EmailPasswordReact from "supertokens-auth-react/recipe/thirdpartyemailpassword";
He just kept the same name
b

Bruno Diferente

06/14/2022, 10:29 AM
Alrighty will check it
I think It is working all fine Thanks bro, Is there a possibility to refactor thirdpaty login / register part so just making custom buttons and call same apis....
n

nkshah2

06/14/2022, 10:38 AM
Yep the recipe exposes all the functions so you can call them manually and handle everything yourself
b

Bruno Diferente

06/14/2022, 10:43 AM
Well for me I didn't use the exposed functions
I have just called the same endpoint
to test it
So i wanted to make new
functions
that behave in same way
n

nkshah2

06/14/2022, 10:45 AM
So if you use SDK version
0.22.0
or above you could just do something similar to
ThirdPartyEmailPassword.thirdPartySignInAndUp
And that would handle calling the API for you
b

Bruno Diferente

06/14/2022, 10:45 AM
reason why: my backend sends extra information so i have to catch it as well
n

nkshah2

06/14/2022, 10:45 AM
That way you wouldnt need to do it manually
You can use the preApiHook and postApiHook features to add and consume additional information too
b

Bruno Diferente

06/14/2022, 10:46 AM
preApiHook
&
postApiHook
!
n

nkshah2

06/14/2022, 10:46 AM
Yep! that way you can leave making the call to the SDK and just handle the part that is custom to you
But if you absolutely need to do the API calls yourself, in that case its best to create the auth form yourself too
b

Bruno Diferente

06/14/2022, 10:48 AM
Exactly that's what I'm doing
Custom page, custom design and just using API's
Is it mandatory to keep config file like that
n

nkshah2

06/14/2022, 10:48 AM
Im not sure what you mean
b

Bruno Diferente

06/14/2022, 10:50 AM
I mean after refactoring all pages and implementing custom pages, will this config file and library implementation still be mandatory
n

nkshah2

06/14/2022, 10:51 AM
So you have a few options: - If you want to either use the pre-built UI or the helper functions we provide you can use the
supertokens-auth-react
SDK in which case yes you would need that config - If you want to handle everything yourself and just have SuperTokens manage cookies and session management for you, you should use the
supertokens-website
SDK which has a minimal config
b

Bruno Diferente

06/14/2022, 10:51 AM
Supertoken would still exist in the backend
n

nkshah2

06/14/2022, 10:51 AM
The website SDK does not have any of the recipes other than Session so you would have to refactor quite a bit
But yes it is possible to have just the bare minimum
b

Bruno Diferente

06/14/2022, 10:52 AM
Gotta keep it as i need the auth wrapper
n

nkshah2

06/14/2022, 10:52 AM
Yes in that case you would need to keep the config
b

Bruno Diferente

06/14/2022, 10:52 AM
Alrighty
Thank you
n

nkshah2

06/14/2022, 10:53 AM
Happy to help!
b

Bruno Diferente

06/14/2022, 10:54 AM
Much appreciated