Abstract the SessionStore out of the Weboob source
Following !1188 (merged) the source (weboob.js) requires a knowledge of the models (the Access) to store its session. I feel like this is wrong.
I suggest we pass a dependency to the source when calling weboob.js with an object that will manage the session storage itself:
{
saveSession: async session => {
await Accesses.update(access.userId, access.id, {
session: session
});
},
deleteSession: async () => {},
getSession: () => {}
}
Edited by Benjamin Bouvier