Skip to content

Commit

Permalink
msw: Implement getSession() helper fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Jan 21, 2025
1 parent 952ca9d commit afe4094
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/crates-io-msw/utils/session.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { db } from '../index.js';

export function getSession() {
let session = db.mswSession.findFirst({});
if (!session) {
return {};
}

let user = session.user;

return { session, user };
}

0 comments on commit afe4094

Please sign in to comment.