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

@live-change/user-service

Package Overview
Dependencies
Maintainers
1
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@live-change/user-service - npm Package Compare versions

Comparing version 0.2.8 to 0.2.10

12

authenticator.js

@@ -19,12 +19,17 @@ const App = require('@live-change/framework')

await authenticatedTable.object(session).onChange(async (authData, oldAuthData) => {
output.debug("NEW USER AUTH", authData, "FROM", oldAuthData)
const newUser = authData ? authData.user : null
if(newUser == user) return
if(user) {
await userObject.unobserve(userObserver)
if(userObject) {
await userObject.unobserve(userObserver)
}
userObject = null
userObserver = null
}
if(authData.user) {
if(newUser) {
user = newUser
output.debug("NEW USER", user)
userObject = userTable.object(user)
const currentUserObject = userObject
await userObject.onChange(async (userData, oldUserData) => {

@@ -36,2 +41,3 @@ const newCredentials = userData ? {

} : null
output.debug("NEW CREDENTIALS", newCredentials)
output.change(newCredentials, oldCredentials)

@@ -43,3 +49,3 @@ oldCredentials = newCredentials

} else { // if user changed before observer loaded data
userObject.unobserve(observer)
currentUserObject.unobserve(observer)
}

@@ -46,0 +52,0 @@ })

@@ -52,12 +52,2 @@ const app = require("@live-change/framework").app()

name: 'signOut',
properties: {
user: {
type: User,
validation: ['nonEmpty']
},
session: {
type: Session,
validation: ['nonEmpty']
}
},
async execute({ }, { client, service }, emit) {

@@ -64,0 +54,0 @@ if(!client.user) throw "notSignedIn"

{
"name": "@live-change/user-service",
"version": "0.2.8",
"version": "0.2.10",
"description": "",

@@ -27,3 +27,3 @@ "main": "index.js",

},
"gitHead": "1e8102d02b6745fea401e967c211c6a9cb03e19b"
"gitHead": "ae86524e5ac7052eb6b6e7b34e319373b6bdef23"
}
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