refactor: lift route middleware to socket
Some checks failed
CI / build (push) Has been cancelled
CI / test (16.x, ) (push) Has been cancelled
CI / test (16.x, -s e2e) (push) Has been cancelled
CI / test (18.x, ) (push) Has been cancelled
CI / test (18.x, -s e2e) (push) Has been cancelled
CI / test (20.x, ) (push) Has been cancelled
CI / test (20.x, -s e2e) (push) Has been cancelled
CI / lint (push) Has been cancelled
Website / website (push) Has been cancelled
release-please / release-please (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
CI / test (16.x, ) (push) Has been cancelled
CI / test (16.x, -s e2e) (push) Has been cancelled
CI / test (18.x, ) (push) Has been cancelled
CI / test (18.x, -s e2e) (push) Has been cancelled
CI / test (20.x, ) (push) Has been cancelled
CI / test (20.x, -s e2e) (push) Has been cancelled
CI / lint (push) Has been cancelled
Website / website (push) Has been cancelled
release-please / release-please (push) Has been cancelled
This commit is contained in:
parent
3bce656949
commit
6425893df0
|
@ -7,10 +7,9 @@ const debugSilly = debug.extend('silly');
|
||||||
export const hooks = {
|
export const hooks = {
|
||||||
'@flecks/db.models': Flecks.provide(require.context('./models')),
|
'@flecks/db.models': Flecks.provide(require.context('./models')),
|
||||||
'@flecks/socket.packets.decorate': Flecks.decorate(require.context('./packets/decorators')),
|
'@flecks/socket.packets.decorate': Flecks.decorate(require.context('./packets/decorators')),
|
||||||
'@flecks/web/server.request.route': Flecks.priority(
|
'@flecks/web/server.request.socket': Flecks.priority(
|
||||||
(flecks) => (req, res, next) => {
|
(flecks) => (req, res, next) => {
|
||||||
flecks.passport.initialize(req, res, () => {
|
flecks.passport.initialize(req, res, () => {
|
||||||
debugSilly('@flecks/web/server.request.route: passport.session()');
|
|
||||||
flecks.passport.session(req, res, () => {
|
flecks.passport.session(req, res, () => {
|
||||||
if (!req.user) {
|
if (!req.user) {
|
||||||
const {User} = flecks.db.Models;
|
const {User} = flecks.db.Models;
|
||||||
|
|
|
@ -9,7 +9,7 @@ const debugSilly = debug.extend('silly');
|
||||||
|
|
||||||
export const hooks = {
|
export const hooks = {
|
||||||
'@flecks/electron/server.extensions': (installer) => [installer.REDUX_DEVTOOLS],
|
'@flecks/electron/server.extensions': (installer) => [installer.REDUX_DEVTOOLS],
|
||||||
'@flecks/web/server.request.route': (flecks) => async (req, res, next) => {
|
'@flecks/web/server.request.socket': (flecks) => async (req, res, next) => {
|
||||||
const slices = await flecks.invokeMergeUniqueAsync('@flecks/redux.slices');
|
const slices = await flecks.invokeMergeUniqueAsync('@flecks/redux.slices');
|
||||||
const reducer = await createReducer(flecks, slices);
|
const reducer = await createReducer(flecks, slices);
|
||||||
// Let the slices have a(n async) chance to hydrate with server data.
|
// Let the slices have a(n async) chance to hydrate with server data.
|
||||||
|
|
|
@ -16,7 +16,7 @@ export const hooks = {
|
||||||
'Set the FLECKS_ENV__flecks_session_server__cookieSecret environment variable!'
|
'Set the FLECKS_ENV__flecks_session_server__cookieSecret environment variable!'
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
'@flecks/web/server.request.route': (flecks) => {
|
'@flecks/web/server.request.socket': (flecks) => {
|
||||||
const urle = express.urlencoded({extended: true});
|
const urle = express.urlencoded({extended: true});
|
||||||
return (req, res, next) => {
|
return (req, res, next) => {
|
||||||
urle(req, res, (error) => {
|
urle(req, res, (error) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user