@bloks/link-session-manager
Advanced tools
Comparing version 0.2.658 to 0.2.659
/** | ||
* proton-link-session-manager v0.2.658 | ||
* proton-link-session-manager v0.2.659 | ||
* https://github.com/greymass/proton-link-session-manager | ||
@@ -4,0 +4,0 @@ * |
/** | ||
* proton-link-session-manager v0.2.658 | ||
* proton-link-session-manager v0.2.659 | ||
* https://github.com/greymass/proton-link-session-manager | ||
@@ -348,3 +348,15 @@ * | ||
ProtonLinkSessionManagerStorage.prototype.add = function (session) { | ||
this.sessions.push(session); | ||
var existingIndex = this.sessions.findIndex(function (s) { | ||
var matchingNetwork = session.network.equals(s.network); | ||
var matchingActor = session.actor.equals(s.actor); | ||
var matchingPermissions = session.permission.equals(s.permission); | ||
var matchingAppName = session.name.equals(s.name); | ||
return matchingNetwork && matchingActor && matchingPermissions && matchingAppName; | ||
}); | ||
if (existingIndex >= 0) { | ||
this.sessions.splice(existingIndex, 1, session); | ||
} | ||
else { | ||
this.sessions.push(session); | ||
} | ||
}; | ||
@@ -351,0 +363,0 @@ ProtonLinkSessionManagerStorage.prototype.get = function (chainId, account, permission) { |
/** | ||
* proton-link-session-manager v0.2.658 | ||
* proton-link-session-manager v0.2.659 | ||
* https://github.com/greymass/proton-link-session-manager | ||
@@ -302,3 +302,15 @@ * | ||
add(session) { | ||
this.sessions.push(session); | ||
const existingIndex = this.sessions.findIndex((s) => { | ||
const matchingNetwork = session.network.equals(s.network); | ||
const matchingActor = session.actor.equals(s.actor); | ||
const matchingPermissions = session.permission.equals(s.permission); | ||
const matchingAppName = session.name.equals(s.name); | ||
return matchingNetwork && matchingActor && matchingPermissions && matchingAppName; | ||
}); | ||
if (existingIndex >= 0) { | ||
this.sessions.splice(existingIndex, 1, session); | ||
} | ||
else { | ||
this.sessions.push(session); | ||
} | ||
} | ||
@@ -305,0 +317,0 @@ get(chainId, account, permission) { |
{ | ||
"name": "@bloks/link-session-manager", | ||
"description": "Session management for signature providers when receiving requests using the Anchor Link protocol", | ||
"version": "0.2.658", | ||
"version": "0.2.659", | ||
"homepage": "https://github.com/greymass/proton-link-session-manager", | ||
@@ -6,0 +6,0 @@ "license": "BSD-3-Clause", |
@@ -26,3 +26,14 @@ import {Checksum256, Name, PrivateKeyType, PublicKeyType} from '@greymass/eosio' | ||
public add(session: ProtonLinkSessionManagerSession) { | ||
this.sessions.push(session) | ||
const existingIndex = this.sessions.findIndex((s) => { | ||
const matchingNetwork = session.network.equals(s.network) | ||
const matchingActor = session.actor.equals(s.actor) | ||
const matchingPermissions = session.permission.equals(s.permission) | ||
const matchingAppName = session.name.equals(s.name) | ||
return matchingNetwork && matchingActor && matchingPermissions && matchingAppName | ||
}) | ||
if (existingIndex >= 0) { | ||
this.sessions.splice(existingIndex, 1, session) | ||
} else { | ||
this.sessions.push(session) | ||
} | ||
} | ||
@@ -29,0 +40,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98433
1648