Auth0 Home Blog Docs

How to use language with nodejs and passportsj


#1

Hi, i have everything setup and working…

We use
passport.authenticate(‘auth0’, {…})
and
passport.use(new Auth0Strategy(…));

But now its time to make other language available in our app…

We know lock can change de language by adding { langauge: ‘fr’ } to options etc…
We also know there is a Template and we can get language in @@config@@…

But how do you set the language from passportjs?

passport.authenticate(‘auth0’, {
clientID: CLIENT_ID,
domain: AUTH0_DOMAIN,
redirectUri: AUTH0_CALLBACK_URL,
audience: ‘https://’ + AUTH0_DOMAIN + ‘/userinfo’,
responseType: ‘code’,
scope: ‘openid email profile’,
language : 'fr’
})

Thanks