Skip to content

Commit

Permalink
frontend: initialize passport earlier
Browse files Browse the repository at this point in the history
It is required for all authentication forms, and must be initialized
prior to handling a request.
  • Loading branch information
gcampax committed Nov 18, 2021
1 parent 21d4766 commit 15648f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/frontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class Frontend {
{ maxAge: 86400000 }));
codeStorage.initFrontend(this._app);
this._app.use(cacheable());
this._app.use(passport.initialize());
passportUtil.initialize();

this._app.use(bodyParser.json());
Expand Down Expand Up @@ -215,7 +216,6 @@ class Frontend {
store: this._sessionStore,
secret: secretKey.getSecretKey() }));
this._app.use(connect_flash());
this._app.use(passport.initialize());
this._app.use(passport.session());

// this is an authentication kludge used by the Android app
Expand Down

0 comments on commit 15648f5

Please sign in to comment.