Revert "Merge pull request #2973 from bluewave-labs/feat/v2/auth"

This reverts commit 72882fded9, reversing
changes made to bfb299cfca.
This commit is contained in:
Alex Holliday committed 2025-09-23 14:05:23 -07:00
1 parent 003d419a64
commit 990aed9f2e
25 files changed
+69 -894

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
class ApiError extends Error {
public status: number;
constructor(message: string, status: number = 500) {
super(message);
this.status = status;
this.name = this.constructor.name;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}
}
export default ApiError;
-22
View File
@@ -1,22 +0,0 @@
import jwt from "jsonwebtoken";
import { AuthResult } from "../service/v2/business/AuthService.js";
const encode = (data: AuthResult): string => {
const secret = process.env.JWT_SECRET;
if (!secret) {
throw new Error("JWT_SECRET is not defined");
}
const token = jwt.sign(data, secret, { expiresIn: "99d" });
return token;
};
const decode = (token: string): AuthResult => {
const secret = process.env.JWT_SECRET;
if (!secret) {
throw new Error("JWT_SECRET is not defined");
}
const decoded = jwt.verify(token, secret) as AuthResult;
return decoded;
};
export { encode, decode };