Finish server-side translations in controllers
This commit is contained in:
@@ -32,7 +32,7 @@ class SAMLController extends Controller {
|
||||
const can_access = await Policy.check_user_access(req.user, associated_app.id)
|
||||
if ( !can_access ) {
|
||||
return this.Vue.auth_message(res, {
|
||||
message: `Sorry, you don't have permission to access this application. Please ask your administrator to grant you access to ${associated_app.name}.`,
|
||||
message: req.T('saml.no_access').replace('APP_NAME', associated_app.name),
|
||||
next_destination: '/dash',
|
||||
})
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class SAMLController extends Controller {
|
||||
cert: await this.saml.public_cert(),
|
||||
key: await this.saml.private_key(),
|
||||
getPostURL: (wtrealm, wreply, req, callback) => {
|
||||
this.output.debug(`SAML Redirect URL: ${req.saml_request.service_provider.acs_url}`)
|
||||
this.output.debug(`${req.T('saml.redirect_url')} ${req.saml_request.service_provider.acs_url}`)
|
||||
return callback(null, req.saml_request.service_provider.acs_url) // fetch this from registered SAML app
|
||||
},
|
||||
profileMapper: user => new FlitterProfileMapper(user),
|
||||
@@ -68,19 +68,19 @@ class SAMLController extends Controller {
|
||||
key: await this.saml.private_key(),
|
||||
protocolBinding: 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
|
||||
clearIdPSession: done => {
|
||||
this.output.info(`Clearing IdP session for user: ${req.user.uid}`)
|
||||
this.output.info(`${req.T('saml.clear_idp_session')} ${req.user.uid}`)
|
||||
req.saml.participants.clear().then(async () => {
|
||||
if ( this.saml.config().slo.end_coreid_session ) {
|
||||
await req.user.get_provider().logout(req)
|
||||
|
||||
// show logout page
|
||||
return this.Vue.auth_message(res, {
|
||||
message: `You have been successfully logged out from ${this.configs.get('app.name')}.`,
|
||||
message: req.T('auth.logged_out'),
|
||||
next_destination: '/',
|
||||
})
|
||||
} else {
|
||||
return this.Vue.auth_message(res, {
|
||||
message: `You have been successfully logged out.`,
|
||||
message: req.T('auth.logged_out'),
|
||||
next_destination: '/',
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user