Skip to content

Commit 1a65b5b

Browse files
feat: adds robolox auth provider
1 parent fd6260c commit 1a65b5b

6 files changed

Lines changed: 3055 additions & 3591 deletions

File tree

bun.lock

Lines changed: 9 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/with-website/pnpm-lock.yaml

Lines changed: 3027 additions & 3442 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/with-website/src/components/AfterLogin/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const AdminLogin = () => {
1212
const handleGoogleSignin = async () => oauth('google')
1313
const handleAuth0Signin = async () => oauth('auth0')
1414
const handleMicrosoftSignin = async () => oauth('msft-entra')
15+
const handleRoboloxSignin = async () => oauth('robolox')
1516

1617
return (
1718
<div className="oauth-container">
@@ -24,6 +25,9 @@ export const AdminLogin = () => {
2425
<Button type="button" onClick={handleMicrosoftSignin} className="oauth-btn">
2526
Signin with Microsoft
2627
</Button>
28+
<Button type="button" onClick={handleRoboloxSignin} className="oauth-btn">
29+
Signin with Robolox
30+
</Button>
2731
</div>
2832
)
2933
}

examples/with-website/src/plugins/index.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
MicrosoftEntraAuthProvider,
2323
PasswordProvider,
2424
TwitchAuthProvider,
25+
RoboloxAuthProvider,
2526
} from 'payload-auth-plugin/providers'
2627
import { AdminAccounts } from '@/collections/Auth/Admin/Accounts'
2728
import { AppUsers } from '@/collections/Auth/App/Users'
@@ -113,6 +114,10 @@ export const plugins: Plugin[] = [
113114
successRedirectPath: '/',
114115
errorRedirectPath: '/auth/signin',
115116
providers: [
117+
RoboloxAuthProvider({
118+
client_id: process.env.ROBOLOX_CLIENT_ID as string,
119+
client_secret: process.env.ROBOLOX_CLIENT_SECRET as string,
120+
}),
116121
GoogleAuthProvider({
117122
client_id: process.env.GOOGLE_CLIENT_ID as string,
118123
client_secret: process.env.GOOGLE_CLIENT_SECRET as string,
@@ -146,13 +151,13 @@ export const plugins: Plugin[] = [
146151
client_id: process.env.AUTH0_CLIENT_ID as string,
147152
client_secret: process.env.AUTH0_CLIENT_SECRET as string,
148153
}),
149-
MicrosoftEntraAuthProvider({
150-
tenant_id: process.env.MSFT_ENTRA_TENANT_ID as string,
151-
client_id: process.env.MSFT_AUTH_CLIENT_ID as string,
152-
client_secret: process.env.MSFT_AUTH_CLIENT_SECRET as string,
154+
MicrosoftEntraAuthProvider({
155+
tenant_id: process.env.MSFT_ENTRA_TENANT_ID as string,
156+
client_id: process.env.MSFT_AUTH_CLIENT_ID as string,
157+
client_secret: process.env.MSFT_AUTH_CLIENT_SECRET as string,
153158

154-
skip_email_verification: true,
155-
})
159+
skip_email_verification: true,
160+
}),
156161
],
157162
}),
158163
]

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"@tsconfig/node22": "^22.0.0",
8181
"@tsconfig/strictest": "^2.0.5",
8282
"@types/bun": "latest",
83-
"@types/jsonwebtoken": "^9.0.7",
8483
"@types/js-cookie": "^3.0.6",
84+
"@types/jsonwebtoken": "^9.0.7",
8585
"cross-env": "^7.0.3",
8686
"git-cliff": "2.7.0",
8787
"globals": "^15.14.0",
@@ -96,5 +96,6 @@
9696
"oauth4webapi": "^3.1.4",
9797
"qs-esm": "7.0.2",
9898
"uuid": "11.1.0"
99-
}
99+
},
100+
"packageManager": "pnpm@10.17.1+sha512.17c560fca4867ae9473a3899ad84a88334914f379be46d455cbf92e5cf4b39d34985d452d2583baf19967fa76cb5c17bc9e245529d0b98745721aa7200ecaf7a"
100101
}

src/client/oauth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export type OauthProvider =
2323
| "jumpcloud"
2424
| "twitch"
2525
| "okta"
26+
| "robolox"
2627

2728
export const oauth = (options: BaseOptions, provider: OauthProvider): void => {
2829
const additionalScope = options.additionalScope || ""

0 commit comments

Comments
 (0)