From 68aca6cd61f1471947eb34de4fd3ac66ce37f394 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Thu, 6 Jan 2022 11:59:48 +0100 Subject: [PATCH] Adds supabase as the issuer for the JWT token --- web/docs/learn/auth-deep-dive/jwts.md | 1 + web/src/components/JwtGenerator.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/web/docs/learn/auth-deep-dive/jwts.md b/web/docs/learn/auth-deep-dive/jwts.md index 228c0418e9d..ae2453ff03b 100644 --- a/web/docs/learn/auth-deep-dive/jwts.md +++ b/web/docs/learn/auth-deep-dive/jwts.md @@ -122,6 +122,7 @@ If we put this token into https://jwt.io, we see it decodes to: ```js { "role": "anon", + "iss": "supabase", "iat": 1614205174, "exp": 1929781174 } diff --git a/web/src/components/JwtGenerator.js b/web/src/components/JwtGenerator.js index 88aafbc930d..aa768cb3374 100644 --- a/web/src/components/JwtGenerator.js +++ b/web/src/components/JwtGenerator.js @@ -9,6 +9,7 @@ const fiveYears = new Date(now.getFullYear() + 5, now.getMonth(), now.getDate()) const anonToken = ` { "role": "anon", + "iss": "supabase", "iat": ${Math.floor(today / 1000)}, "exp": ${Math.floor(fiveYears / 1000)} } @@ -17,6 +18,7 @@ const anonToken = ` const serviceToken = ` { "role": "service_role", + "iss": "supabase", "iat": ${Math.floor(today / 1000)}, "exp": ${Math.floor(fiveYears / 1000)} }