From 6e5c371b4087c0b30084bc6d71c0a1c73633710e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Valverd=C3=A9?= Date: Sat, 7 Sep 2024 19:24:33 +0200 Subject: [PATCH] JSONWebToken work --- src/JSONWebToken.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/JSONWebToken.ts b/src/JSONWebToken.ts index f088049..401ee6f 100644 --- a/src/JSONWebToken.ts +++ b/src/JSONWebToken.ts @@ -3,7 +3,9 @@ import type * as JWT from "jsonwebtoken" import { ImportError } from "./ImportError" -export class JSONWebToken extends Context.Tag("JSONWebToken")() {} + +export interface JSONWebTokenService { sign: ( payload: string | object | Buffer, secretOrPrivateKey: JWT.Secret, @@ -12,7 +14,7 @@ export class JSONWebToken extends Context.Tag("JSONWebToken"), + > verify: ( token: string, @@ -22,8 +24,8 @@ export class JSONWebToken extends Context.Tag("JSONWebToken"), -}>() {} + > +} const importJWT = Effect.tryPromise({