Skip to content

Commit

Permalink
Merge pull request #5 from supertokens/feat/add_oauth2provider
Browse files Browse the repository at this point in the history
feat: add oauth2provider
  • Loading branch information
porcellus authored Oct 31, 2024
2 parents ca6f38e + fc8cab8 commit b19f779
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 31 deletions.
6 changes: 3 additions & 3 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"files": {
"main.js": "/static/js/main.ba50d5ee.js",
"main.js": "/static/js/main.81589a39.js",
"index.html": "/index.html",
"main.ba50d5ee.js.map": "/static/js/main.ba50d5ee.js.map"
"main.81589a39.js.map": "/static/js/main.81589a39.js.map"
},
"entrypoints": [
"static/js/main.ba50d5ee.js"
"static/js/main.81589a39.js"
]
}
2 changes: 1 addition & 1 deletion build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link href="//fonts.googleapis.com/css2?family=Rubik:wght@400&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.ba50d5ee.js"></script></head><body><script>window.addEventListener("supertokensScriptLoaded",(()=>{supertokensInit("supertokensui",{appInfo:{websiteDomain:"http://localhost:3000",apiDomain:"http://localhost:3001",appName:"My Demo App"},style:"\n [data-supertokens~=container] {\n --palette-background: 51, 51, 51;\n --palette-inputBackground: 41, 41, 41;\n --palette-inputBorder: 41, 41, 41;\n --palette-textTitle: 255, 255, 255;\n --palette-textLabel: 255, 255, 255;\n --palette-textPrimary: 255, 255, 255;\n --palette-error: 173, 46, 46;\n --palette-textInput: 169, 169, 169;\n --palette-textLink: 169, 169, 169;\n }\n "})}))</script><noscript>You need to enable JavaScript to run this app.</noscript><div id="supertokensui"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link href="//fonts.googleapis.com/css2?family=Rubik:wght@400&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.81589a39.js"></script></head><body><script>window.addEventListener("supertokensScriptLoaded",(()=>{supertokensInit("supertokensui",{appInfo:{websiteDomain:"http://localhost:3000",apiDomain:"http://localhost:3001",appName:"My Demo App"},style:"\n [data-supertokens~=container] {\n --palette-background: 51, 51, 51;\n --palette-inputBackground: 41, 41, 41;\n --palette-inputBorder: 41, 41, 41;\n --palette-textTitle: 255, 255, 255;\n --palette-textLabel: 255, 255, 255;\n --palette-textPrimary: 255, 255, 255;\n --palette-error: 173, 46, 46;\n --palette-textInput: 169, 169, 169;\n --palette-textLink: 169, 169, 169;\n }\n "})}))</script><noscript>You need to enable JavaScript to run this app.</noscript><div id="supertokensui"></div></body></html>
3 changes: 3 additions & 0 deletions build/static/js/main.81589a39.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/js/main.81589a39.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions build/static/js/main.ba50d5ee.js

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/main.ba50d5ee.js.map

This file was deleted.

40 changes: 18 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"supertokens-auth-react": "0.47.1"
"supertokens-auth-react": "0.48.0"
},
"devDependencies": {
"@types/react": "^18.0.18",
Expand Down
9 changes: 9 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Session from "supertokens-auth-react/recipe/session";
import EmailVerification from "supertokens-auth-react/recipe/emailverification"
import MFA from "supertokens-auth-react/recipe/multifactorauth"
import TOTP from "supertokens-auth-react/recipe/totp"
import OAuth2Provider from "supertokens-auth-react/recipe/oauth2provider"
import UserRoles from "supertokens-auth-react/recipe/userroles"
import MultiTenancy from "supertokens-auth-react/recipe/multitenancy"

Expand All @@ -20,6 +21,7 @@ import { SessionPreBuiltUI } from "supertokens-auth-react/recipe/session/prebuil
import { EmailVerificationPreBuiltUI } from "supertokens-auth-react/recipe/emailverification/prebuiltui"
import { MultiFactorAuthPreBuiltUI } from "supertokens-auth-react/recipe/multifactorauth/prebuiltui"
import { TOTPPreBuiltUI } from "supertokens-auth-react/recipe/totp/prebuiltui"
import { OAuth2ProviderPreBuiltUI } from "supertokens-auth-react/recipe/oauth2provider/prebuiltui"

export let PreBuiltUIList: any[] = [];

Expand Down Expand Up @@ -76,6 +78,13 @@ export let PreBuiltUIList: any[] = [];
return TOTP.init(input);
}
};
(window as any).supertokensUIOAuth2Provider = {
...OAuth2Provider,
init: (input: any) => {
PreBuiltUIList.push(OAuth2ProviderPreBuiltUI);
return OAuth2Provider.init(input);
}
};

(window as any).supertokensUIMultitenancy = MultiTenancy;
(window as any).supertokensUIUserRoles = UserRoles;
Expand Down

0 comments on commit b19f779

Please sign in to comment.