summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorppoulard <philippe.poulard@inria.fr>2018-07-03 15:55:19 +0200
committerppoulard <philippe.poulard@inria.fr>2018-07-03 15:55:19 +0200
commitee81775dc8306a9e88d6c7573864f12269f78c01 (patch)
tree5f0ef74a6478ed8b48c1becb588ce56f2eec9eb7 /client/components
parent05869792ad09edbe9dacc67460b5e98e9642bb2a (diff)
downloadwekan-ee81775dc8306a9e88d6c7573864f12269f78c01.tar.gz
wekan-ee81775dc8306a9e88d6c7573864f12269f78c01.tar.bz2
wekan-ee81775dc8306a9e88d6c7573864f12269f78c01.zip
Adding SSO CAS to Wekan
Diffstat (limited to 'client/components')
-rw-r--r--client/components/main/layouts.jade3
-rw-r--r--client/components/main/layouts.js17
2 files changed, 20 insertions, 0 deletions
diff --git a/client/components/main/layouts.jade b/client/components/main/layouts.jade
index 4d76aabb..911f23f4 100644
--- a/client/components/main/layouts.jade
+++ b/client/components/main/layouts.jade
@@ -17,6 +17,9 @@ template(name="userFormsLayout")
img(src="{{pathFor '/wekan-logo.png'}}" alt="Wekan")
section.auth-dialog
+Template.dynamic(template=content)
+ if isCas
+ .at-form
+ button#cas(class='at-btn submit' type='submit') {{casSignInLabel}}
div.at-form-lang
select.select-lang.js-userform-set-language
each languages
diff --git a/client/components/main/layouts.js b/client/components/main/layouts.js
index f12718a7..ab47c8ed 100644
--- a/client/components/main/layouts.js
+++ b/client/components/main/layouts.js
@@ -39,6 +39,16 @@ Template.userFormsLayout.helpers({
const curLang = T9n.getLanguage() || 'en';
return t9nTag === curLang;
},
+
+ isCas() {
+ return Meteor.settings.public &&
+ Meteor.settings.public.cas &&
+ Meteor.settings.public.cas.loginUrl
+ },
+
+ casSignInLabel() {
+ return TAPi18n.__('casSignIn', {}, T9n.getLanguage() || 'en');
+ },
});
Template.userFormsLayout.events({
@@ -47,6 +57,13 @@ Template.userFormsLayout.events({
T9n.setLanguage(i18nTagToT9n(i18nTag));
evt.preventDefault();
},
+ 'click button#cas'() {
+ Meteor.loginWithCas(function() {
+ if (FlowRouter.getRouteName() == 'atSignIn') {
+ FlowRouter.go('/');
+ }
+ });
+ },
});
Template.defaultLayout.events({