mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
46706646e3
refs #10060 - Modules extractions done here are meant to make upcoming migration of authentication controller to v2 more manageable and reduce code repetition - There were couple modules extracted for different areas that controller touches: passwordrest, accept (for invitation), setup - The aim was to keep changes to the minimum while making small readability improvements to new functions through async/await syntax - The biggest barrier to make more encapsulated functions was the fact that we mutate options parameter on multiple levels in the controller. e.g mutations of options.data during validation on the password reset ties it up to the implementation of doReset function
35 lines
658 B
JavaScript
35 lines
658 B
JavaScript
module.exports = {
|
|
get authorize() {
|
|
return require('./authorize');
|
|
},
|
|
|
|
get authenticate() {
|
|
return require('./authenticate');
|
|
},
|
|
|
|
get session() {
|
|
return require('./session');
|
|
},
|
|
|
|
get setup() {
|
|
return require('./setup');
|
|
},
|
|
|
|
get passwordreset() {
|
|
return require('./passwordreset');
|
|
},
|
|
|
|
/*
|
|
* TODO: Get rid of these when v0.1 is gone
|
|
*/
|
|
get init() {
|
|
return (options) => {
|
|
require('./oauth').init(options);
|
|
return require('./passport').init(options);
|
|
};
|
|
},
|
|
get oauth() {
|
|
return require('./oauth');
|
|
}
|
|
};
|