remove strict toggle

This commit is contained in:
Riccardo Balbo 2024-10-18 17:20:24 +02:00
parent 1ef2af3f5d
commit fea990390a
2 changed files with 2 additions and 4 deletions

View File

@ -3,7 +3,6 @@ export * from 'wallets/blink'
export async function testSendPayment ({ apiKey, currency }, { logger }) { export async function testSendPayment ({ apiKey, currency }, { logger }) {
logger.info('trying to fetch ' + currency + ' wallet') logger.info('trying to fetch ' + currency + ' wallet')
const strict = false
const scopes = await getScopes(apiKey) const scopes = await getScopes(apiKey)
if (!scopes.includes(SCOPE_READ)) { if (!scopes.includes(SCOPE_READ)) {
throw new Error('missing READ scope') throw new Error('missing READ scope')
@ -11,7 +10,7 @@ export async function testSendPayment ({ apiKey, currency }, { logger }) {
if (!scopes.includes(SCOPE_WRITE)) { if (!scopes.includes(SCOPE_WRITE)) {
throw new Error('missing WRITE scope') throw new Error('missing WRITE scope')
} }
if (strict && scopes.includes(SCOPE_RECEIVE)) { if (scopes.includes(SCOPE_RECEIVE)) {
throw new Error('RECEIVE scope must not be present') throw new Error('RECEIVE scope must not be present')
} }

View File

@ -4,12 +4,11 @@ import { msatsToSats } from '@/lib/format'
export * from 'wallets/blink' export * from 'wallets/blink'
export async function testCreateInvoice ({ apiKeyRecv, currencyRecv }) { export async function testCreateInvoice ({ apiKeyRecv, currencyRecv }) {
const strict = true
const scopes = await getScopes(apiKeyRecv) const scopes = await getScopes(apiKeyRecv)
if (!scopes.includes(SCOPE_READ)) { if (!scopes.includes(SCOPE_READ)) {
throw new Error('missing READ scope') throw new Error('missing READ scope')
} }
if (strict && scopes.includes(SCOPE_WRITE)) { if (scopes.includes(SCOPE_WRITE)) {
throw new Error('WRITE scope must not be present') throw new Error('WRITE scope must not be present')
} }
if (!scopes.includes(SCOPE_RECEIVE)) { if (!scopes.includes(SCOPE_RECEIVE)) {