bitwiz
04/14/2023, 8:15 PMrp
04/15/2023, 6:26 AMbitwiz
04/15/2023, 7:07 AMrp
04/15/2023, 7:08 AMbitwiz
04/15/2023, 12:23 PMrp
04/15/2023, 12:25 PMbitwiz
04/15/2023, 12:25 PMhttps://cdn.discordapp.com/attachments/1096529105702355034/1096807175428505620/image.pngā¾
rp
04/15/2023, 2:42 PMbitwiz
04/15/2023, 2:44 PM<ThirdpartyPasswordlessComponentsOverrideProvider
components={{
// In this case, the <ThirdPartyPasswordlessHeader_Override>
// will render the original component
// wrapped in a div with an octocat picture above it.
ThirdPartyPasswordlessHeader_Override: ({ DefaultComponent, ...props }) => {
return (
<div>
<img src={"https://avatars.githubusercontent.com/u/583231"} height={50} />
<DefaultComponent {...props} />
</div>
);
},
ThirdPartySignInAndUpProvidersForm_Override: ({ DefaultComponent, ...props }) => {
console.log("props", props);
const url = getThirdPartyAuthorisationURLWithQueryParamsAndSetState({
providerId: "github",
});
console.log("url", url);
return (
<div>
<button onClick={async () => window.open(await url)}>Hamlo</button>
<DefaultComponent {...props} />
</div>
);
},
}}
>
rp
04/15/2023, 2:45 PMbitwiz
04/15/2023, 2:46 PMThirdPartyPasswordless.Google({
clientId: "1060725074195-kmeum4crr01uirfl2op9kd5acmi9jutn.apps.googleusercontent.com",
clientSecret: "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",
}),
ThirdPartyPasswordless.Github({
clientSecret: "e97051221f4b6426e8fe8d51486396703012f5bd",
clientId: "467101b197249757c71f",
}),
ThirdPartyPasswordless.Apple({
clientId: "4398792-io.supertokens.example.service",
clientSecret: {
keyId: "7M48Y4RYDL",
privateKey:
"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgu8gXs+XYkqXD6Ala9Sf/iJXzhbwcoG5dMh1OonpdJUmgCgYIKoZIzj0DAQehRANCAASfrvlFbFCYqn3I2zeknYXLwtH30JuOKestDbSfZYxZNMqhF/OzdZFTV0zc5u5s3eN+oCWbnvl0hM+9IW0UlkdA\n-----END PRIVATE KEY-----",
teamId: "YWQCXGJRJL",
},
}),
??? I changed nothing thererp
04/15/2023, 2:46 PMbitwiz
04/15/2023, 2:47 PMrp
04/15/2023, 2:54 PMbitwiz
04/15/2023, 2:59 PMrp
04/15/2023, 2:59 PMbitwiz
04/15/2023, 3:00 PMrp
04/15/2023, 3:01 PMbitwiz
04/15/2023, 3:01 PMrp
04/15/2023, 3:02 PMbitwiz
04/15/2023, 3:02 PMrp
04/15/2023, 3:03 PMbitwiz
04/15/2023, 3:04 PMrp
04/15/2023, 3:07 PMsattvikc
04/17/2023, 1:22 PMbitwiz
04/17/2023, 2:18 PMauthorisationURL: `${getWebsiteDomain()}/auth/callback/${provider.id}`}
Or did you change something in the backend or on your callback page?
Thank you again so much!rp
04/17/2023, 2:46 PMbitwiz
04/17/2023, 2:54 PMrp
04/17/2023, 2:59 PMbitwiz
04/17/2023, 3:03 PMhttps://cdn.discordapp.com/attachments/1096529105702355034/1097537905972490322/image.pngā¾
rp
04/17/2023, 3:05 PMbitwiz
04/17/2023, 3:08 PMrp
04/17/2023, 3:17 PMbitwiz
04/17/2023, 3:17 PMwindow.close()
is executed?rp
04/17/2023, 3:18 PMdynamic.com
and your static hosted endpoint is static.com
.bitwiz
04/17/2023, 3:26 PMrp
04/17/2023, 3:37 PMstate
query param which our SDK generates. You can save this state
param in the shopify app (in memory) before opening the popup window.
- When google sends the user back to the callback page on your static app, this same state param is also present in the callback URL. You can save this state param in localstorage of your static site. So at this point, you have a common state param stored in your shopify app (in memory) and the static site.
- After the static site is logged in (after it has a session with the backend), it could send the stored state param to your backend. On the backend, you create an API which accepts this state param along with verifying the session.
- Post session verification, this API has the userId and the state param. It can store this mapping in memory.
- Meanwhile the shopify app can poll the backend with the state param, and if that API sees that there is a mapping of this state param to a userID, it can simply create a new (header based / non cookie based) session and return a 200 to the frontend - thereby logging in the user.bitwiz
04/17/2023, 3:40 PMrp
04/17/2023, 3:41 PM