feat(server): auto refresh session (#6613)

This commit is contained in:
EYHN
2024-04-19 07:00:12 +00:00
parent a2fa9149ff
commit 5e243de392
7 changed files with 82 additions and 16 deletions
@@ -303,7 +303,7 @@ test('should throw if oauth account already connected', async t => {
});
// @ts-expect-error mock
Sinon.stub(auth, 'getUser').resolves({ id: 'u2-id' });
Sinon.stub(auth, 'getUser').resolves({ user: { id: 'u2-id' } });
mockOAuthProvider(app, 'u2@affine.pro');
@@ -325,7 +325,7 @@ test('should be able to connect oauth account', async t => {
const { app, u1, auth, db } = t.context;
// @ts-expect-error mock
Sinon.stub(auth, 'getUser').resolves({ id: u1.id });
Sinon.stub(auth, 'getUser').resolves({ user: { id: u1.id } });
mockOAuthProvider(app, u1.email);