Skip to content

Commit d0a03b5

Browse files
committed
Merge branch 'feature/fix-relative-logout-service-url' into develop
2 parents 0502812 + f2ac579 commit d0a03b5

8 files changed

Lines changed: 16 additions & 7 deletions

File tree

src/main/java/io/cos/cas/osf/web/flow/config/OsfCasWebflowContextConfiguration.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,13 @@ public CasWebflowConfigurer defaultLogoutWebflowConfigurer() {
5959
osfCasLogoutWebFlowConfigurer.setOrder(Ordered.HIGHEST_PRECEDENCE);
6060
return osfCasLogoutWebFlowConfigurer;
6161
}
62+
63+
// TODO: Move all server-specific URLs, endpoints and other attributes to a dedicated class and initialize it as a
64+
// bean. ThymeLeaf templates can access Spring beans, which solves the issue of CasConfigurationProperties
65+
// accessibility in templates. For more details, refer to section "Spring Beans" in the following guide:
66+
// https://www.thymeleaf.org/doc/articles/springmvcaccessdata.html for details
67+
@Bean(name="casServerLoginUrl")
68+
public String casServerLoginUrl() {
69+
return casProperties.getServer().getName() + "/login";
70+
}
6271
}

src/main/resources/templates/casAccountDisabledView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 th:utext="#{screen.accountdisabled.heading}"></h2>
3333
</a>
3434
</section>
3535
<hr class="my-4" />
36-
<section class="text-with-mdi" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
36+
<section class="text-with-mdi" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3737
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
3838
</section>
3939
</section>

src/main/resources/templates/casInstitutionSsoFailedView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<h2 th:utext="#{screen.institutionssofailed.heading}"></h2>
2828
<p th:utext="#{screen.institutionssofailed.message}"></p>
2929
</section>
30-
<section class="form-button" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
30+
<section class="form-button" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3131
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${loginUrl})}">
3232
<span class="mdc-button__label" th:utext="#{screen.error.page.loginagain}"></span>
3333
</a>

src/main/resources/templates/casInvalidUserStatusView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 th:utext="#{screen.invaliduserstatus.heading}"></h2>
3333
</a>
3434
</section>
3535
<hr class="my-4" />
36-
<section class="text-with-mdi" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
36+
<section class="text-with-mdi" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3737
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
3838
</section>
3939
</section>

src/main/resources/templates/casInvalidVerificationKeyView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 th:utext="#{screen.invalidverificationkey.heading}"></h2>
3333
</a>
3434
</section>
3535
<hr class="my-4" />
36-
<section class="text-with-mdi" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
36+
<section class="text-with-mdi" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3737
<span><a th:href="@{/logout(service=${loginUrl})}" th:utext="#{screen.error.page.loginagain}"></a></span>
3838
</section>
3939
</section>

src/main/resources/templates/casLogoutView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 th:utext="#{screen.generic.logoutsuccess.heading}"></h2>
3333
</a>
3434
</section>
3535
<hr class="my-4" />
36-
<section class="text-with-mdi" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
36+
<section class="text-with-mdi">
3737
<span><a th:href="@{/login(casRedirectSource=cas)}" th:utext="#{screen.generic.logoutsuccess.link.login}"></a></span>
3838
</section>
3939
</section>

src/main/resources/templates/casServiceErrorView.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<h2 th:utext="#{screen.service.error.heading}"></h2>
2828
<p th:if="${rootCauseException != null and rootCauseException.code != null}" th:utext="#{${rootCauseException.code}}"></p>
2929
</section>
30-
<section class="form-button" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
30+
<section class="form-button" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3131
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${loginUrl})}">
3232
<span class="mdc-button__label" th:utext="#{screen.error.page.loginagain}"></span>
3333
</a>

src/main/resources/templates/error.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h2 th:utext="#{screen.unavailable.heading}"></h2>
3333
<pre th:utext="${'Timestamp: ' + #dates.formatISO(#dates.createNow())}"></pre>
3434
<pre th:text="${'Message: ' + message}"></pre>
3535
</section>
36-
<section class="form-button" th:with="loginUrl=@{/login(casRedirectSource=cas)}">
36+
<section class="form-button" th:with="loginUrl=@{${@casServerLoginUrl}(casRedirectSource=cas)}">
3737
<a class="mdc-button mdc-button--raised button-osf-blue" th:href="@{/logout(service=${loginUrl})}">
3838
<span class="mdc-button__label" th:utext="#{screen.error.page.loginagain}"></span>
3939
</a>

0 commit comments

Comments
 (0)