Skip to content

Commit ff6befe

Browse files
committed
feat: add utils module with auth function for JWT handling
1 parent 9a24052 commit ff6befe

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

packages/auth/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from './utils'
12
export * from './Auth'
23
export * from './Session'
34
export * from './SessionDevice'

packages/auth/src/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Auth } from './Auth'
2+
3+
/**
4+
* Create a new instance of the Auth class with an optional secret for JWT
5+
* signing and verification.
6+
*
7+
* @param secret — The secret key used for signing and verifying JWTs.
8+
*
9+
* @returns — A new instance of the Auth class.
10+
*/
11+
export const auth = (secret?: string | undefined) => Auth.make(secret)

0 commit comments

Comments
 (0)