mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 01:29:21 +00:00
fix(i18n): use everywhere i18n.getUserLanguage middleware - part 2
This commit is contained in:
parent
9aa118e334
commit
4ac10585bb
1 changed files with 4 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ var utils = require('../utils');
|
|||
var nconf = require('nconf');
|
||||
var User = require('../models/user').model;
|
||||
var ga = require('./../utils').ga;
|
||||
var i18n = require('./../i18n');
|
||||
|
||||
var api = module.exports;
|
||||
|
||||
|
|
@ -223,7 +224,7 @@ api.changePassword = function(req, res, next) {
|
|||
|
||||
api.setupPassport = function(router) {
|
||||
|
||||
router.get('/logout', function(req, res) {
|
||||
router.get('/logout', i18n.getUserLanguage, function(req, res) {
|
||||
req.logout();
|
||||
delete req.session.userId;
|
||||
res.redirect('/');
|
||||
|
|
@ -236,6 +237,7 @@ api.setupPassport = function(router) {
|
|||
// redirect the user back to this application at /auth/facebook/callback
|
||||
router.get('/auth/facebook',
|
||||
passport.authenticate('facebook'),
|
||||
i18n.getUserLanguage,
|
||||
function(req, res){
|
||||
// The request will be redirected to Facebook for authentication, so this
|
||||
// function will not be called.
|
||||
|
|
@ -248,6 +250,7 @@ api.setupPassport = function(router) {
|
|||
// which, in this example, will redirect the user to the home page.
|
||||
router.get('/auth/facebook/callback',
|
||||
passport.authenticate('facebook', { failureRedirect: '/login' }),
|
||||
i18n.getUserLanguage,
|
||||
function(req, res) {
|
||||
//res.redirect('/');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue