Can someone hwlp me out with difference between we...
# support-questions-legacy
p
Can someone hwlp me out with difference between web-js and auth-node package, I was using web-js as mentioned for own ui, and was trying to add custom login provider to support for linkdln, but getting error for defining
signInAndUpFeature
in recipeList
Copy code
Argument of type '{ signInAndUpFeature: { providers: { id: string; name: string; buttonComponent: JSX.Element; }[]; }; }' is not assignable to parameter of type 'UserInput'.
  Object literal may only specify known properties, and 'signInAndUpFeature' does not exist in type 'UserInput'.ts(2345)
https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/signup-form/custom-providers
r
hey @paras which version of the sdks are you using?
n
Hi @paras if you are using the web-js SDK then there is no additional setup required with SuperTokens for your custom provider on the frontend In the docs you want to generally refer to the "Plain Javascript" tab if its present for web-js docs. Some pages will also have a way to switch between auth-react and web-js docs in the top right of the content
p
latest only,
n
You're referring to the auth-react SDK docs @paras . Refer to this message
p
I didn't find the way to switch bw, an I got confused b/w auth-react anfd web-js as far as I can Understand, with own ui uses web-js and pre-built uses auth-react for frontend
For my case I was using my own ui that means - web-js for frontend, and I was trying to setup custom login via Linkedln and was getting issues export function getApiDomain() { const apiPort = process.env.REACT_APP_API_PORT || 3001; const apiUrl = process.env.REACT_APP_API_URL || `http://localhost:${apiPort}`; return apiUrl; } export function getWebsiteDomain() { const websitePort = process.env.REACT_APP_WEBSITE_PORT || 3000; const websiteUrl = process.env.REACT_APP_WEBSITE_URL || `http://localhost:${websitePort}`; return websiteUrl; } export const SupertokenConfig = { appInfo: { appName: "Demo App", apiDomain: getApiDomain(), websiteDomain: getWebsiteDomain(), }, // recipeList contains all the modules that you want to // use from SuperTokens. See the full list here: https://supertokens.com/docs/guides recipeList: [ ThirdPartyEmailPassword.init({ signInAndUpFeature: { providers: [ { id: "linkedin", name: "Linkedin", buttonComponent: <div style={{ cursor: "pointer", border: "1", paddingTop: "5px", paddingBottom: "5px", borderRadius: "5px", borderStyle: "solid" }}>Login with Linkedin } ], }} ), Session.init(), ], }; export const recipeDetails = { docsLink: "https://supertokens.com/docs/thirdpartyemailpassword/introduction", };
n
Right so where did you get the
signInAndUpFeature
snippet from?
n
Right so the frontend has a tab for plain javascript for that. But yeah the custom providers need no additional setup on the frontend for web-js. You just need to do the backend setup
p
I did the same, and still getting issues
n
You should see error logs for that in your backend
p
Backend is running in docker and could't find any logs related to this
n
What backend framework are you using?
p
NodeJs
n
Express?
p
yes
n
In your backends default error handler you can log the error out and you should see logs for them in the docker logs
p
okk, lemme try this too
I used the error handler like this https://supertokens.com/docs/passwordless/custom-ui/init/backend, still no logs
n
I mean the default error handler for your express app (the express docs can explain how to set it up), not the SuperTokens error handler
p
the
/auth/signinip
is getting called twice, and the bearer token get an error
revoked by user
r
are you calling the api yourself in a useEffect in react?
p
no.
r
then? Can you give me more context?
p
I was running the core in my local i.e docker and when I click signup with linkedln, the authurl is not fetched properly everytime, but when it gets fetched, I see two calls for /signinup in my network tab one gets failed with status code 500 and one gets successful sometimes both gets failed with axios error, when checked I found it was an issue with bearer token
r
you are using our pre built UI? And that is making 2 calls to the signinup API? Is that correct?
p
nope, I used my own UI and getting 2 calls
but no where in my code I made call to /signinup
r
are you calling the signinup function from web-js somewhere? There has to be some place where a call is being made to this API, else how can it be made (since it's your own UI)
p
I have no mention of /auth/signinup in my code
so probable from core only it's getting called twice
r
Core doesn’t call this api
Search for signinup in your code
p
so from where does it get called?
r
you must be calling it in your code. Please check
it's an API that's called from the frontend to the backend
p
n
Search without the "/"
p
still no instance
n
Ah sorry search for
signinandup
p
r
yea so this is the issue. In dev mode in react, react calls useEffects twice
so you need to solve for that - ask in the react community please or google it
p
okkh thanks
7 Views