Skip to content

Commit 834f191

Browse files
atrakhConvex, Inc.
authored andcommitted
Add apiauth.convex.dev as an allowed issuer (#40149)
GitOrigin-RevId: c99bbf811616cdb8a4651c6294bb518aaa0a7d1c
1 parent 3e77a90 commit 834f191

File tree

1 file changed

+15
-0
lines changed
  • crates/authentication/src

1 file changed

+15
-0
lines changed

crates/authentication/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,9 @@ where
737737
))
738738
})?;
739739

740+
// TODO(ari): This can be cleaned up into one if statement, but I was lazy for
741+
// the moment. Once the migration is done, there will be only one issuer to
742+
// check
740743
if issuer.contains("api.workos.com") {
741744
anyhow::ensure!(
742745
*issuer
@@ -761,6 +764,18 @@ where
761764
format!("Issuer {} does not match WorkOS client ID", issuer)
762765
)
763766
)
767+
} else if issuer.contains("apiauth.convex.dev") {
768+
anyhow::ensure!(
769+
*issuer
770+
== format!(
771+
"https://apiauth.convex.dev/user_management/{}",
772+
workos_client_id
773+
),
774+
ErrorMetadata::unauthenticated(
775+
"AccessTokenInvalid",
776+
format!("Issuer {} does not match WorkOS client ID", issuer)
777+
)
778+
)
764779
} else {
765780
anyhow::ensure!(
766781
workos_auth_urls.iter().any(|url| {

0 commit comments

Comments
 (0)