mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
Merge branch 'scopedpat/scoped-token-creation-sheet' into scopedpat/scoped-token-creation-tests
This commit is contained in:
1 file changed
+6
-3
+6
-3
@@ -40,8 +40,10 @@ export const NewScopedTokenSheet = () => {
|
||||
name: values.tokenName.trim(),
|
||||
permissions,
|
||||
...(expires_at ? { expires_at } : {}),
|
||||
...(values.resourceAccess === 'project' ? values.projectRefs : {}),
|
||||
...(values.resourceAccess === 'organization' ? values.organizationSlugs : {}),
|
||||
...(values.resourceAccess === 'project' ? { project_refs: values.projectRefs } : {}),
|
||||
...(values.resourceAccess === 'organization'
|
||||
? { organization_slugs: values.organizationSlugs }
|
||||
: {}),
|
||||
}
|
||||
|
||||
createToken(payload, {
|
||||
@@ -62,7 +64,8 @@ export const NewScopedTokenSheet = () => {
|
||||
// By default, if users created a token successfully, they can't click outside the sheet to close it
|
||||
// as we need to make sure they copied the new token first
|
||||
const handleOpenChange = (open: boolean, isSafe = false) => {
|
||||
if (step === 'success' && !isSafe) return
|
||||
if (open === false && step === 'success' && !isSafe) return
|
||||
setStep('form')
|
||||
setIsOpen(open)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user