@ccci/micro-server 1.0.94 → 1.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -113669,9 +113669,6 @@ function generate(payload) {
113669
113669
  function verify(token) {
113670
113670
  console.log("process.env.JWT_SECRET_KEY :>> ", process.env.JWT_SECRET_KEY);
113671
113671
  let decoded = import_jsonwebtoken.default.verify(token, SECRET_KEY);
113672
- if (decoded.iss !== ISSUER) {
113673
- throw new Error("Token Issuer is not valid");
113674
- }
113675
113672
  return decoded;
113676
113673
  }
113677
113674
  function decode(val2) {
@@ -113726,6 +113723,7 @@ class RouterFactory {
113726
113723
  if (bearerToken && bearerToken != null && bearerToken != "null") {
113727
113724
  const token = bearerToken.split(" ")[1];
113728
113725
  let decoded = verify(token);
113726
+ req.user = decoded;
113729
113727
  } else if (!grantPublicAccess)
113730
113728
  return res.status(401).send({ success: false, error: 1004, errorMessage: "Unauthorized. No access token found on the request." });
113731
113729
  next();
@@ -119701,6 +119699,7 @@ class BaseModel extends Model {
119701
119699
  class BaseSocketHandler {
119702
119700
  static channel = "default";
119703
119701
  static server;
119702
+ static websocket;
119704
119703
  async upgrade(req, server) {
119705
119704
  if (server.upgrade(req, { data: { channel: BaseSocketHandler.channel } })) {
119706
119705
  return;
@@ -5,6 +5,7 @@ import type { Server, ServerWebSocket } from 'bun';
5
5
  export default class BaseSocketHandler {
6
6
  static channel: string;
7
7
  static server: Server;
8
+ static websocket: ServerWebSocket;
8
9
  /**
9
10
  *
10
11
  * @param req {Request}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccci/micro-server",
3
- "version": "1.0.94",
3
+ "version": "1.0.96",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",