AnthonyMusgrove / Emby-ScripterX

Run custom external application or script (batch/bash/powershell/php/python/node.js/custom) on various events within the Emby Server.
https://emby-scripterx.com
76 stars 6 forks source link

_onAuthenticationSuccess is never called #40

Closed Slugger closed 4 years ago

Slugger commented 4 years ago

Describe the bug When a user logs in successfully, the _onAuthenticationSuccess() handler from a package is never called.

To Reproduce Steps to reproduce the behavior:

  1. Install a package with the _onAuthenticationSuccess() handler defined
  2. Trigger the event
  3. View debug logs, see that package event handler wasn't called

Expected behavior The event handler from my package should be called.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

AnthonyMusgrove commented 4 years ago

Thank you for reporting this one mate. This was my issue. The invoker command was accidentally mis-typed as '_onAuthenticatedSuccess', I've now fixed this and it is now '_onAuthenticationSuccess' and functions as expected:

function _onAuthenticationSuccess(context) { ScripterX.Log.Info("Successful login by " + context.Token("%username%").value); }

now yields:

2020-06-21 21:55:08.668 Info Emby ScripterX: 8b91c4d0-66f2-47c8-9471-ae9c741d6b6f: Successful login by Anthony

This will be released in v3.0.4.6 tonight. v3.0.4.5 introduces Package API functions (check out the wiki for info: https://wiki.emby-scripterx.info/books/packages/page/api-extensions)