Ghost/core/server/services/auth/session/index.js
Fabien O'Carroll cb0c5dc582
Session auth service (#9910)
refs #9865

* This service handles the session store and exporting middleware to be
used for creating and managing sessions

* Updates the auth service index.js file in line with how we do things elsewhere

* After wrapping the exports in a getter, the usage of rewire had broken
the authenticate tests, this commit _removes_ rewire from the tests, calls `init` on
the models before the tests (needed because rewire isn't there) and also
cleans up the use of var.
2018-10-02 15:35:23 +07:00

24 lines
624 B
JavaScript

module.exports = {
get getSession() {
return require('./middleware').getSession;
},
get cookieCsrfProtection() {
return require('./middleware').cookieCsrfProtection;
},
get safeGetSession() {
return require('./middleware').safeGetSession;
},
get createSession() {
return require('./middleware').createSession;
},
get destroySession() {
return require('./middleware').destroySession;
},
get getUser() {
return require('./middleware').getUser;
},
get ensureUser() {
return require('./middleware').ensureUser;
}
};