1.0.2 • Published 6 years ago

mscp-user v1.0.2

Weekly downloads
12
License
-
Repository
-
Last release
6 years ago

User handler for MSCP services

Requirements:

  • A running mscp-metadata service

Include it as a handler:

let mscp = new MSCP({"": require("./handler.js"), "user": require("mscp-user")})

In handlers needing to check for username:

const User = require("mscp-user")
async init(){
  ....
  this.username = User.getUsernameFromHandlerRequest(this)
  ...
}
async validateAccess(functionName){
  return this.username ? true : false
}

Don't forget to add the function login (and optionally createUser and isLoggedIn) to your service in the namespace "user".

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago