@velas/account-agent
Version:
sdk
21 lines (16 loc) • 497 B
JavaScript
/*
* Find all active sessions of the browser and bind to interaction
*/
async function bindSessions(next) {
const sessions = await this.provider.Session.find();
this.interaction.sessions = sessions.map((item) => {
return {
account: item.account,
op_key: item.op_key,
count: Object.keys(item.authorizations || {}).length,
authorizations: item.authorizations,
};
});
await next();
};
export default bindSessions;