File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ type (
187
187
Auth0 tpaAuth0 `toml:"auth0"`
188
188
Cognito tpaCognito `toml:"aws_cognito"`
189
189
Clerk tpaClerk `toml:"clerk"`
190
+ WorkOs tpaWorkOs `toml:"workos"`
190
191
}
191
192
192
193
rateLimit struct {
@@ -225,6 +226,12 @@ type (
225
226
Domain string `toml:"domain"`
226
227
}
227
228
229
+ tpaWorkOs struct {
230
+ Enabled bool `toml:"enabled"`
231
+
232
+ IssuerUrl string `toml:"issuer_url"`
233
+ }
234
+
228
235
email struct {
229
236
EnableSignup bool `toml:"enable_signup"`
230
237
DoubleConfirmChanges bool `toml:"double_confirm_changes"`
Original file line number Diff line number Diff line change @@ -1314,6 +1314,17 @@ func (c *tpaClerk) validate() (err error) {
1314
1314
return nil
1315
1315
}
1316
1316
1317
+ func (w * tpaWorkOs ) validate () error {
1318
+ if w .IssuerUrl == "" {
1319
+ return errors .New ("Invalid config: auth.third_party.workos is enabled but without a issuer_url." )
1320
+ }
1321
+ return nil
1322
+ }
1323
+
1324
+ func (w * tpaWorkOs ) issuerURL () string {
1325
+ return w .IssuerUrl
1326
+ }
1327
+
1317
1328
func (tpa * thirdParty ) validate () error {
1318
1329
enabled := 0
1319
1330
@@ -1349,6 +1360,14 @@ func (tpa *thirdParty) validate() error {
1349
1360
}
1350
1361
}
1351
1362
1363
+ if tpa .WorkOs .Enabled {
1364
+ enabled += 1
1365
+
1366
+ if err := tpa .WorkOs .validate (); err != nil {
1367
+ return err
1368
+ }
1369
+ }
1370
+
1352
1371
if enabled > 1 {
1353
1372
return errors .New ("Invalid config: Only one third_party provider allowed to be enabled at a time." )
1354
1373
}
@@ -1373,6 +1392,10 @@ func (tpa *thirdParty) IssuerURL() string {
1373
1392
return tpa .Clerk .issuerURL ()
1374
1393
}
1375
1394
1395
+ if tpa .WorkOs .Enabled {
1396
+ return tpa .WorkOs .issuerURL ()
1397
+ }
1398
+
1376
1399
return ""
1377
1400
}
1378
1401
You can’t perform that action at this time.
0 commit comments