Skip to content

Commit 8e8d2a7

Browse files
committed
msw/session: Implement getSession() fn
1 parent 56d3740 commit 8e8d2a7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export function getSession(db) {
2+
let session = db.mswSession.findFirst({});
3+
if (!session) {
4+
return {};
5+
}
6+
7+
let user = session.user;
8+
9+
return { session, user };
10+
}

0 commit comments

Comments
 (0)