Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@supabase/realtime-js

Package Overview
Dependencies
Maintainers
12
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@supabase/realtime-js - npm Package Compare versions

Comparing version 2.10.7 to 2.10.8

2

dist/main/lib/version.d.ts

@@ -1,2 +0,2 @@

export declare const version = "2.10.7";
export declare const version = "2.10.8";
//# sourceMappingURL=version.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = '2.10.7';
exports.version = '2.10.8';
//# sourceMappingURL=version.js.map

@@ -288,2 +288,17 @@ "use strict";

setAuth(token) {
if (token) {
let parsed = null;
try {
parsed = JSON.parse(atob(token.split('.')[1]));
}
catch (_error) { }
if (parsed && parsed.exp) {
let now = Math.floor(Date.now() / 1000);
let valid = now - parsed.exp < 0;
if (!valid) {
this.log('auth', `provided token has expired, not sending it to realtime`);
return;
}
}
}
this.accessToken = token;

@@ -290,0 +305,0 @@ this.channels.forEach((channel) => {

@@ -1,2 +0,2 @@

export declare const version = "2.10.7";
export declare const version = "2.10.8";
//# sourceMappingURL=version.d.ts.map

@@ -1,2 +0,2 @@

export const version = '2.10.7';
export const version = '2.10.8';
//# sourceMappingURL=version.js.map

@@ -260,2 +260,17 @@ import { CHANNEL_EVENTS, CONNECTION_STATE, DEFAULT_HEADERS, DEFAULT_TIMEOUT, SOCKET_STATES, TRANSPORTS, VSN, WS_CLOSE_NORMAL, } from './lib/constants';

setAuth(token) {
if (token) {
let parsed = null;
try {
parsed = JSON.parse(atob(token.split('.')[1]));
}
catch (_error) { }
if (parsed && parsed.exp) {
let now = Math.floor(Date.now() / 1000);
let valid = now - parsed.exp < 0;
if (!valid) {
this.log('auth', `provided token has expired, not sending it to realtime`);
return;
}
}
}
this.accessToken = token;

@@ -262,0 +277,0 @@ this.channels.forEach((channel) => {

{
"name": "@supabase/realtime-js",
"version": "2.10.7",
"version": "2.10.8",
"description": "Listen to realtime updates to your PostgreSQL database",

@@ -44,3 +44,3 @@ "keywords": [

"@types/ws": "^8.5.10",
"ws": "^8.14.2"
"ws": "^8.18.0"
},

@@ -55,2 +55,3 @@ "devDependencies": {

"jsdom-global": "3.0.0",
"jsonwebtoken": "^9.0.2",
"mock-socket": "^9.0.3",

@@ -57,0 +58,0 @@ "npm-run-all": "^4.1.5",

@@ -1,1 +0,1 @@

export const version = '2.10.7'
export const version = '2.10.8'

@@ -338,2 +338,20 @@ import type { WebSocket as WSWebSocket } from 'ws'

setAuth(token: string | null): void {
if (token) {
let parsed = null
try {
parsed = JSON.parse(atob(token.split('.')[1]))
} catch (_error) {}
if (parsed && parsed.exp) {
let now = Math.floor(Date.now() / 1000)
let valid = now - parsed.exp < 0
if (!valid) {
this.log(
'auth',
`provided token has expired, not sending it to realtime`
)
return
}
}
}
this.accessToken = token

@@ -340,0 +358,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc