+10
@@ -0,0 +1,10 @@
|
||||
import {Result} from 'result'
|
||||
|
||||
export type JWT = `${string}.${string}.${string}`
|
||||
|
||||
export function create() : Result<JWT> {
|
||||
throw "todo"
|
||||
}
|
||||
export function verify() : boolean {
|
||||
throw "todo"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export function hash(pwd: string) : Promise<string> {
|
||||
return Bun.password.hash(pwd)
|
||||
}
|
||||
|
||||
export async function verify(pwd: string, hash: string) : Promise<boolean> {
|
||||
return Bun.password.verify(pwd, hash).catch(() => false)
|
||||
}
|
||||
Reference in New Issue
Block a user