duta
05/12/2022, 7:02 AMrp_st
05/12/2022, 7:04 AMrp_st
05/12/2022, 7:04 AMduta
05/12/2022, 7:09 AMrp_st
05/12/2022, 7:35 AMrp_st
05/12/2022, 7:35 AMduta
05/12/2022, 7:45 AMduta
05/12/2022, 7:46 AMrp_st
05/12/2022, 8:09 AMduta
05/12/2022, 8:24 AMrp_st
05/12/2022, 8:30 AMrp_st
05/12/2022, 8:30 AMrp_st
05/12/2022, 8:34 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.rp_st
05/12/2022, 8:35 AMsignInUpPOST
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.rp_st
05/12/2022, 8:36 AMduta
05/12/2022, 10:04 AMduta
05/14/2022, 7:58 AMrp_st
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_st
05/14/2022, 8:00 AMduta
05/14/2022, 8:08 AMrp_st
05/14/2022, 8:09 AMrp_st
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_st
05/14/2022, 8:10 AMrp_st
05/14/2022, 8:11 AMconst SignInAndUpNoSSR = dynamic(
new Promise((res) => res(SignInAndUp)) as any,
{ ssr: false }
)
export default function Auth() {
return (
<SignInAndUpNoSSR />
)
}
duta
05/14/2022, 8:11 AMduta
05/15/2022, 4:03 AMgetOAuthAuthorisationURL
?
my current implementation is
override:{
functions: (originalImplementation: ThirdPartyReact.UserInput)=>{
return{
...originalImplementation,
getOAuthAuthorisationURL: function (e){
console.log(e)
}}
}
}
rp_st
05/15/2022, 5:05 AMrp_st
05/15/2022, 5:05 AMduta
05/15/2022, 5:09 AMrp_st
05/15/2022, 5:12 AMrp_st
05/15/2022, 5:12 AMduta
05/15/2022, 5:53 AMduta
05/15/2022, 11:17 AMrp_st
05/15/2022, 11:18 AMduta
05/15/2022, 11:18 AM