flixoflax
06/23/2022, 7:02 AMrp_st
06/23/2022, 7:04 AMflixoflax
06/23/2022, 7:05 AMrp_st
06/23/2022, 7:05 AMrp_st
06/23/2022, 7:05 AMrp_st
06/23/2022, 7:05 AMrp_st
06/23/2022, 7:06 AMflixoflax
06/23/2022, 7:06 AMrp_st
06/23/2022, 7:06 AMflixoflax
06/23/2022, 7:07 AMrp_st
06/23/2022, 7:12 AMts
import Router from 'next/router'
SuperTokens.init({
appInfo: {...},
recipeList: [...],
windowHandler: (oI) => {
return {
...oI,
location: {
...oI.location,
setHref: (href) => {
Router.push(href)
}
}
}
}
})
flixoflax
06/23/2022, 7:13 AMflixoflax
06/23/2022, 7:14 AMrp_st
06/23/2022, 7:15 AMflixoflax
06/23/2022, 7:16 AMrp_st
06/23/2022, 7:18 AMflixoflax
06/23/2022, 7:20 AMrp_st
06/23/2022, 7:20 AMflixoflax
06/23/2022, 7:22 AMrp_st
06/23/2022, 7:22 AMrp_st
06/23/2022, 7:23 AMflixoflax
06/23/2022, 7:24 AMrp_st
06/23/2022, 7:25 AMflixoflax
06/23/2022, 7:28 AMrp_st
06/23/2022, 7:31 AMflixoflax
06/23/2022, 7:33 AMrp_st
06/23/2022, 7:34 AMflixoflax
06/23/2022, 7:36 AMrp_st
06/23/2022, 7:36 AMrp_st
06/23/2022, 7:37 AMrp_st
06/23/2022, 7:38 AMrp_st
06/23/2022, 7:38 AMflixoflax
06/23/2022, 8:22 AMrp_st
06/23/2022, 8:22 AMrp_st
06/23/2022, 8:22 AMflixoflax
06/23/2022, 8:49 AMflixoflax
06/23/2022, 8:49 AMflixoflax
06/23/2022, 8:49 AMrp_st
06/23/2022, 9:01 AMThirdPartyEmailPassword.init({
override: {
functions: (oI) => {
return {
...oI,
emailPasswordSignIn: async function (input) {
window.localStorage.removeItem("isEmailverified");
return oI.emailPasswordSignIn(input);
},
emailPasswordSignUp: async function (input) {
window.localStorage.removeItem("isEmailverified");
return oI.emailPasswordSignUp(input);
},
thirdPartySignInAndUp: async function (input) {
window.localStorage.removeItem("isEmailverified");
return oI.thirdPartySignInAndUp(input);
},
}
},
emailVerification: {
functions: (oI) => {
return {
...oI,
isEmailVerified: async function (input) {
let fromLocalstorage = window.localStorage.getItem("isEmailverified");
if (fromLocalstorage == null) {
let fromAPI = await oI.isEmailVerified(input);
if (fromAPI.isVerified) {
window.localStorage.setItem("isEmailverified", "true");
}
return fromAPI;
} else {
return {
fetchResponse: new Response(),
isVerified: fromLocalstorage === "true",
status: "OK",
}
}
}
}
}
}
}
})
rp_st
06/23/2022, 9:02 AMflixoflax
06/23/2022, 9:23 AMrp_st
06/23/2022, 9:24 AMflixoflax
06/23/2022, 9:24 AMflixoflax
06/23/2022, 9:24 AMrp_st
06/23/2022, 9:24 AMrp_st
06/23/2022, 9:25 AMflixoflax
06/23/2022, 9:25 AMrp_st
06/23/2022, 9:26 AMflixoflax
06/23/2022, 9:26 AMflixoflax
06/23/2022, 9:26 AMrp_st
06/23/2022, 9:26 AMflixoflax
06/23/2022, 9:26 AMflixoflax
06/23/2022, 9:27 AMrp_st
06/23/2022, 9:28 AMThirdPartyEmailPassword.init({
override: {
emailVerification: {
functions: (oI) => {
return {
...oI,
isEmailVerified: async function (input) {
let accessTokenPayload = await Session.getAccessTokenPayloadSecurely();
return {
fetchResponse: new Response(),
isVerified: accessTokenPayload.isEmailVerified,
status: "OK",
}
}
}
}
}
}
})
rp_st
06/23/2022, 9:29 AMisEmailVerified
in the access token payload.flixoflax
06/23/2022, 9:29 AMflixoflax
06/23/2022, 9:29 AMflixoflax
06/23/2022, 9:35 AMflixoflax
06/23/2022, 9:37 AMflixoflax
06/23/2022, 9:37 AMflixoflax
06/23/2022, 9:50 AMthirdparty.isEmailVerified(userId)
before the thing was actually initializedflixoflax
06/23/2022, 9:51 AMflixoflax
06/23/2022, 9:51 AMflixoflax
06/23/2022, 10:54 AMflixoflax
06/23/2022, 10:54 AMrp_st
06/23/2022, 11:06 AMflixoflax
06/23/2022, 11:15 AMflixoflax
06/23/2022, 11:15 AMflixoflax
06/23/2022, 11:26 AMflixoflax
06/23/2022, 11:38 AMOverride: &tpepmodels.OverrideStruct{
EmailVerificationFeature: &evmodels.OverrideStruct{
APIs: func(originalImplementation evmodels.APIInterface) evmodels.APIInterface {
originalVerifyEmailPOST := *originalImplementation.VerifyEmailPOST
(*originalImplementation.VerifyEmailPOST) = func(token string, options evmodels.APIOptions, userContext supertokens.UserContext) (evmodels.VerifyEmailUsingTokenResponse, error) {
resp, err := originalVerifyEmailPOST(token, options, userContext)
if err != nil {
return evmodels.VerifyEmailUsingTokenResponse{}, err
}
if resp.OK != nil {
// TODO: Update AccessTokenPayload
}
return resp, err
}
return originalImplementation
},
},
},
rp_st
06/23/2022, 11:41 AMflixoflax
06/23/2022, 12:08 PMflixoflax
06/23/2022, 12:23 PMflixoflax
06/23/2022, 12:24 PMflixoflax
06/23/2022, 12:25 PMflixoflax
06/23/2022, 12:29 PMrp_st
06/23/2022, 12:49 PMgo
sessionRequired := false;
session, err := session.GetSessionWithContext(options.Req, options.Res, &sessmodels.VerifySessionOptions{
SessionRequired: &sessionRequired,
}, userContext)
if err != nil {
return evmodels.GenerateEmailVerifyTokenPOSTResponse{}, err
}
if session != nil {
// TODO: update access token payload of current session -> this will reflect instantly
}
// get all sessions belonging resp.OK.User.ID and update their access token payload as well.
flixoflax
06/23/2022, 12:50 PMflixoflax
06/23/2022, 12:51 PMrp_st
06/23/2022, 12:52 PMflixoflax
06/23/2022, 12:53 PMflixoflax
06/23/2022, 12:54 PMflixoflax
06/23/2022, 12:55 PMrp_st
06/23/2022, 12:58 PMrp_st
06/23/2022, 12:59 PMrp_st
06/23/2022, 12:59 PMrp_st
06/23/2022, 1:01 PMrp_st
06/23/2022, 1:01 PMflixoflax
06/23/2022, 1:09 PMflixoflax
06/23/2022, 1:10 PMflixoflax
06/23/2022, 1:14 PMflixoflax
06/23/2022, 1:14 PMflixoflax
06/23/2022, 1:18 PMrp_st
06/23/2022, 1:19 PMrp_st
06/23/2022, 1:19 PMflixoflax
06/23/2022, 1:34 PMrp_st
06/23/2022, 1:35 PMrp_st
06/23/2022, 1:35 PMflixoflax
06/23/2022, 1:35 PMrp_st
06/23/2022, 1:35 PMrp_st
06/23/2022, 1:35 PMrp_st
06/23/2022, 1:36 PMflixoflax
06/23/2022, 1:36 PMflixoflax
06/23/2022, 1:36 PMflixoflax
06/23/2022, 1:36 PMflixoflax
06/23/2022, 1:36 PMrp_st
06/23/2022, 1:36 PMflixoflax
06/23/2022, 1:37 PMflixoflax
06/23/2022, 1:37 PMflixoflax
06/23/2022, 1:37 PMflixoflax
06/23/2022, 1:37 PMrp_st
06/23/2022, 1:37 PMrp_st
06/23/2022, 1:37 PMrp_st
06/23/2022, 1:38 PMflixoflax
06/23/2022, 1:38 PMflixoflax
06/23/2022, 1:38 PMrp_st
06/23/2022, 1:38 PMrp_st
06/23/2022, 1:38 PMflixoflax
06/23/2022, 1:39 PMflixoflax
06/23/2022, 1:39 PMrp_st
06/23/2022, 1:39 PMflixoflax
06/23/2022, 1:39 PMrp_st
06/23/2022, 1:39 PMrp_st
06/23/2022, 1:39 PMrp_st
06/23/2022, 1:39 PMflixoflax
06/23/2022, 1:39 PMrp_st
06/23/2022, 1:40 PMrp_st
06/23/2022, 1:40 PMrp_st
06/23/2022, 1:40 PMflixoflax
06/23/2022, 1:40 PMflixoflax
06/23/2022, 1:40 PMflixoflax
06/23/2022, 1:40 PMrp_st
06/23/2022, 1:40 PMflixoflax
06/23/2022, 1:41 PMflixoflax
06/23/2022, 1:41 PMflixoflax
06/23/2022, 1:41 PMflixoflax
06/23/2022, 1:42 PMrp_st
06/23/2022, 1:42 PMflixoflax
06/23/2022, 1:42 PMrp_st
06/23/2022, 1:42 PMflixoflax
06/23/2022, 1:43 PMflixoflax
06/23/2022, 1:43 PMrp_st
06/23/2022, 1:44 PMrp_st
06/23/2022, 1:44 PMflixoflax
06/23/2022, 1:45 PMflixoflax
06/23/2022, 1:46 PMrp_st
06/23/2022, 1:50 PMrp_st
06/23/2022, 1:50 PMflixoflax
06/23/2022, 2:09 PMrp_st
06/23/2022, 2:20 PMflixoflax
06/23/2022, 2:24 PMflixoflax
06/23/2022, 2:25 PMrp_st
06/23/2022, 2:33 PMflixoflax
06/23/2022, 3:01 PMflixoflax
06/23/2022, 3:01 PMflixoflax
06/23/2022, 3:01 PMrp_st
06/23/2022, 3:02 PMflixoflax
06/23/2022, 3:05 PMrp_st
06/23/2022, 3:06 PMflixoflax
06/23/2022, 3:55 PM