mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Make the login form pluggable
Allow extending the login form with additional authentication methods by adding them to the web plugin's loginForms array.
This commit is contained in:
1 parent
579f6421e4
commit
ceae2b25b5
3 files changed
+66
-13
No files matched your search
@@ -424,6 +424,21 @@ class BaseControlPlugin {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Plugin supplied login form
|
||||
* @typedef {Object} module:lib/plugin~LoginForm
|
||||
* @property {string} name -
|
||||
* Internal name of the login form, this should start with the
|
||||
* plugin name followed by a dot.
|
||||
* @property {string} title -
|
||||
* Name displayed above this form in the login window.
|
||||
* @property {React.Component} Component -
|
||||
* React component that's rendered for this login form. This is
|
||||
* supplied the setToken function via its props which should be
|
||||
* called when an authentication token is aquired via this
|
||||
* form.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base class for web interface plugins
|
||||
*
|
||||
@@ -455,6 +470,13 @@ class BaseWebPlugin {
|
||||
* `error`, `warn`, `audit`, `info` and `verbose`.
|
||||
*/
|
||||
this.logger = logger.child({ plugin: this.info.name });
|
||||
|
||||
/**
|
||||
* List of login forms provided by this plugin
|
||||
*
|
||||
* @type {Array<module:lib/plugin~LoginForm>}
|
||||
*/
|
||||
this.loginForms = [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user