From 8301d83651b33b415b20a448e682f2adcc327b51 Mon Sep 17 00:00:00 2001
From: Guillaume Rousse <guillaume.rousse@renater.fr>
Date: Thu, 29 Nov 2018 17:23:36 +0100
Subject: [PATCH] use authentication prior to first step

---
 lib/AccountManager/App.pm           | 1 +
 templates/web/edugain/home.tt2.html | 2 +-
 templates/web/renater/home.tt2.html | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/AccountManager/App.pm b/lib/AccountManager/App.pm
index c31c61f..63f6f47 100644
--- a/lib/AccountManager/App.pm
+++ b/lib/AccountManager/App.pm
@@ -183,6 +183,7 @@ sub respond {
 
     $in{data}->{app} = {
         url           => $ENV{SCRIPT_NAME},
+        login_url     => $self->{configuration}->{app}->{login_url},
         name          => $self->{configuration}->{app}->{name},
         support_email => $self->{configuration}->{app}->{support_email},
         version       => $version,
diff --git a/templates/web/edugain/home.tt2.html b/templates/web/edugain/home.tt2.html
index 86a0eac..c4b5d83 100644
--- a/templates/web/edugain/home.tt2.html
+++ b/templates/web/edugain/home.tt2.html
@@ -9,6 +9,6 @@
 
 <h2>[% lh.maketext("Get started") %]</h2>
 <p>[% lh.maketext("To start testing your own services, start by selecting one your are administrator for.") %]</p>
-<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Get started") %]</a></p>
+<p class="text-center"><a href="[% app.login_url %]?target=[% app.url %]%3Faction%3Dselect_federation" class="button">[% lh.maketext("Get started") %]</a></p>
 
 [% END %]
diff --git a/templates/web/renater/home.tt2.html b/templates/web/renater/home.tt2.html
index ede3193..dde4a7b 100644
--- a/templates/web/renater/home.tt2.html
+++ b/templates/web/renater/home.tt2.html
@@ -9,6 +9,6 @@
 
 <h2>[% lh.maketext("Get started") %]</h2>
 <p>[% lh.maketext("To start testing your own services, start by selecting one your are administrator for.") %]</p>
-<p class="text-center"><a href="[% app.url %]?action=select_federation" class="button">[% lh.maketext("Get started") %]</a></p>
+<p class="text-center"><a href="[% app.login_url %]?target=[% app.url %]%3Faction%3Dselect_federation" class="button">[% lh.maketext("Get started") %]</a></p>
 
 [% END %]
-- 
GitLab