Ghost/core/server/services/auth/index.js
Naz Gargol 46706646e3
Refactored authentication controller v0.1 (#10893)
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
2019-07-17 12:28:16 +02:00

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');
}
};