Perform Actions on User Login. This can get handy, if you want to send an HTTP-request to your home automation system, after a user is recognized by MMM-Facial-Recognition.
- An installation of MagicMirror²
- npm
- request
-
Clone this repo into
~/MagicMirror/modules
directory. -
Configure your
~/MagicMirror/config/config.js
:{ module: 'MMM-LoginAction', config: { ... } }
-
Run command
npm install --productive
in~/MagicMirror/modules/MMM-LoginAction
directory.
Option | Default | Description |
---|---|---|
baseUrl |
'https://www.hello.world/user/{@}/{@}' |
The url you want to call. {@} is the placeholder to use. |
actions |
{ login: 1, logout: 0 } |
You can set the value for the login and logout action. It can be a String, Number, Boolean, etc. |
users |
{ JohnDoe: [ 'JohnDoe', 'ACTION' ] } |
The users have an array with values. Those values get used to fill out the placeholders of the baseUrl . The value ACTION will be replaced by either the login or logout action value. |
The default values would look like this:
- Login
https://www.hello.world/user/JohnDoe/1
- Logout
https://www.hello.world/user/JohnDoe/0