JSONWebToken work
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2024-09-07 19:24:33 +02:00
parent da597f763d
commit 6e5c371b40

View File

@@ -3,7 +3,9 @@ import type * as JWT from "jsonwebtoken"
import { ImportError } from "./ImportError"
export class JSONWebToken extends Context.Tag("JSONWebToken")<JSONWebToken, {
export class JSONWebToken extends Context.Tag("JSONWebToken")<JSONWebToken, JSONWebTokenService>() {}
export interface JSONWebTokenService {
sign: (
payload: string | object | Buffer,
secretOrPrivateKey: JWT.Secret,
@@ -12,7 +14,7 @@ export class JSONWebToken extends Context.Tag("JSONWebToken")<JSONWebToken, {
string,
Error,
never
>,
>
verify: (
token: string,
@@ -22,8 +24,8 @@ export class JSONWebToken extends Context.Tag("JSONWebToken")<JSONWebToken, {
string | JWT.Jwt | JWT.JwtPayload,
JWT.VerifyErrors | Error,
never
>,
}>() {}
>
}
const importJWT = Effect.tryPromise({