Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pulgueta/PDFizado
Browse files Browse the repository at this point in the history
  • Loading branch information
pulgueta committed May 11, 2024
2 parents 87ad33c + 6a6d516 commit 9a2e3bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/auth/currentUser.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { cache } from 'react';

import { auth } from './auth';

export const currentUser = async () => {
export const currentUser = cache(async () => {
const user = await auth();

if (!user) return;

return user.user;
};
});

export type CurrentUser = Awaited<ReturnType<typeof currentUser>>;

0 comments on commit 9a2e3bd

Please sign in to comment.