duta
05/12/2022, 7:02 AMrp
05/12/2022, 7:04 AMduta
05/12/2022, 7:09 AMrp
05/12/2022, 7:35 AMduta
05/12/2022, 7:45 AMrp
05/12/2022, 8:09 AMduta
05/12/2022, 8:24 AMrp
05/12/2022, 8:30 AMgetOAuthAuthorisationURL
function (https://supertokens.com/docs/thirdparty/advanced-customizations/frontend-functions-override/usage) to store some info in the localstorage indicating what type (student or teacher) is trying to login / sign up (based on the current path of the page)
You also want to give the preAPI hook (https://supertokens.com/docs/thirdparty/advanced-customizations/frontend-hooks/pre-api) to add that extra info (if it's a student or teacher) in the request body when the action === "THIRD_PARTY_SIGN_IN_UP"
. You can read this value from the localstorage you had set earlier.signInUpPOST
function to read that custom field from the request object and can add it to the user metadata in case the sign in / up was successful.duta
05/12/2022, 10:04 AMrp
05/14/2022, 7:58 AMduta
05/14/2022, 8:00 AMimport type { NextPage } from 'next'
import { SignInAndUp } from 'supertokens-auth-react/recipe/thirdparty'
import dynamic from 'next/dynamic'
const Student: NextPage = () => {
return (
<div>
<SignInAndUp/>
</div>
)
}
export default Student
how to i wrap in in the dynamic HOCrp
05/14/2022, 8:00 AMduta
05/14/2022, 8:08 AMrp
05/14/2022, 8:09 AMduta
05/14/2022, 8:10 AMimport React, { useEffect } from 'react'
import dynamic from 'next/dynamic'
import SuperTokens from 'supertokens-auth-react'
const SuperTokensComponentNoSSR = dynamic(
new Promise((res) => res(SuperTokens.getRoutingComponent)) as any,
{ ssr: false }
)
export default function Auth() {
return (
<SuperTokensComponentNoSSR />
)
}
and yes i have enabled js on my browserrp
05/14/2022, 8:10 AMconst SignInAndUpNoSSR = dynamic(
new Promise((res) => res(SignInAndUp)) as any,
{ ssr: false }
)
export default function Auth() {
return (
<SignInAndUpNoSSR />
)
}
duta
05/14/2022, 8:11 AMgetOAuthAuthorisationURL
?
my current implementation is
override:{
functions: (originalImplementation: ThirdPartyReact.UserInput)=>{
return{
...originalImplementation,
getOAuthAuthorisationURL: function (e){
console.log(e)
}}
}
}
rp
05/15/2022, 5:05 AMduta
05/15/2022, 5:09 AMrp
05/15/2022, 5:12 AMduta
05/15/2022, 5:53 AMrp
05/15/2022, 11:18 AMduta
05/15/2022, 11:18 AM