UNPKG

@velas/account-agent

Version:

sdk

19 lines (13 loc) 483 B
import assert from '../helper/assert'; /* * Validates the redirect uri */ async function checkRedirectUri(next) { const { redirect_uri } = this.params; assert.check(redirect_uri, { type: 'string', message: 'redirect_uri option is required' }); if ( !this.interaction.client.redirect_uris.includes(redirect_uri)) { throw new Error('redirect_uri does not match the ones authorized for the client'); } await next(); } export default checkRedirectUri;