funk101
06/12/2022, 4:48 AMrp
06/12/2022, 5:47 AMrp
06/12/2022, 5:48 AMrp
06/12/2022, 6:00 AMDiesel
06/12/2022, 9:04 AMITEnthusiasm
06/12/2022, 12:35 PMzachwebb
06/12/2022, 11:27 PMzachwebb
06/12/2022, 11:52 PMrp
06/13/2022, 4:27 AMEdwinN1337
06/13/2022, 9:53 AMjs
if (platform === 'APP') {
url.searchParams.append('redirect_uri', `${APP_BUNDLE_URL}/auth/callback/${provider}`)
await openAppBrowser(url.href)
}
if (platform !== 'APP') {
url.searchParams.append('redirect_uri', `${FRONTEND_URL}/auth/callback/${provider}`)
window.location.href = url.href
}
I was thinking of initliazing a different backendConfig based on the request? Not sure if that's the right approach?
Anyone have done this before?rp
06/13/2022, 10:16 AMdhatGuy
06/13/2022, 11:01 AMgetUserById
function?ITEnthusiasm
06/13/2022, 4:10 PMOskar
06/13/2022, 4:46 PMrp
06/13/2022, 5:05 PMflixoflax
06/14/2022, 7:17 AMnick-signature
06/14/2022, 8:36 AMBruno Diferente
06/14/2022, 10:24 AMauth
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.haimantika
06/14/2022, 1:35 PMromanpalenik
06/14/2022, 2:05 PMmrserif
06/14/2022, 5:53 PMEdwinN1337
06/15/2022, 8:01 AMjs
resetPasswordUsingTokenFeature: {
createAndSendCustomEmail: async (user, url) => {
//based on the platform (app or web) it's a different URL
https://app.swaggerhub.com/apis/supertokens/FDI/1.13.2#/ThirdPartyEmailPassword%20Recipe/thirdPartyEmailPasswordPasswordResetTokenAtoyebs
06/15/2022, 10:54 AMDiesel
06/15/2022, 12:20 PMgetRedirectionURL: async (context) => {
if (context.action === "SUCCESS") {
let redirectUrl = context.redirectToPath
if (redirectUrl !== undefined) {
console.log("yoo redirected path");
console.log(redirectUrl)
// we are navigating back to where the user was before they authenticated
return redirectUrl
}
}
return undefined;
},
I call the sign in with redirectToPath in the url like so
https://auth.my.subdomain.com/auth?redirectToPath=https://www.app.my.subdomain.com
and i get that the context.redirectToPath is empty and it just redirects me to the home page of my auth web instead to my web app.
When i tried setting the web app url hardcoded in the return of getRedirectionURL it works like a charm and redirected me to the web app.
Any idea if this is possible? or only paths are allowed to be redirected to?
(Thanks for the help so far you have given me)ashlite
06/15/2022, 1:45 PMjs
override:{
components:{
EmailPasswordSignUpForm_Override:({DefaultComponent, ...props}) => {
useEffect(() => {
const passwordConfirm = document.querySelector('input[name="passwordConfirm"]')
console.log(passwordConfirm) //for checking purpose
if (passwordConfirm){
passwordConfirm.setAttribute("type", "password")
}
}, [])
return <DefaultComponent {...props} />
}
}
}
ashlite
06/15/2022, 2:09 PMjs
import React from 'react'
import dynamic from 'next/dynamic'
import { ThirdPartyEmailPasswordAuth } from "supertokens-auth-react/recipe/thirdpartyemailpassword"
const AuthWrapper = dynamic(
new Promise((res) => res(ThirdPartyEmailPasswordAuth)),
{ssr: false}
)
export default function Guard({children, requiredAuth}) {
return <AuthWrapper requiredAuth={requiredAuth}>{children}</AuthWrapper>
}
Then I apply in a auth button, the problem is the page will be in infinite loop pointing to auth page. This auth button is is in navbar template so it is happening in everypage.
js
export default function AuthButton(){
let {doesSessionExist} = useSessionContext()
console.log(doesSessionExist)
return(
<>
<Guard requiredAuth={false}>
{doesSessionExist ?
<Button w="full" size="lg" colorScheme="red" onClick={e => logout(e)}>Logout</Button>
:
<Button w="full" size="lg" colorScheme="green" onClick={e => login(e)}>Sign-In / Sign-Up</Button>
}
</Guard>
</>
)
}
And because the code in here too, problem three is doesSessionExist always return falseBruno Diferente
06/15/2022, 2:18 PMashlite
06/15/2022, 7:23 PMfunk101
06/16/2022, 3:44 AMaccessTokenPayload()
in front endfunk101
06/16/2022, 3:49 AMawait superTokensNextWrapper(
async (next) => {
await verifySession()(req, res, next);
},
req,
res
);
const currentAccessTokenPayload = req.session.getAccessTokenPayload();