Skip to content

Commit

Permalink
show option to log as guest if default login is hidden
Browse files Browse the repository at this point in the history
Solves #11
  • Loading branch information
pwielgolaski committed Jul 29, 2017
1 parent eb5db59 commit a9df953
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ public boolean isAllowInsecureHttps() {
.map(Boolean::valueOf)
.orElse(true);
}

public boolean isGuestLoginAllowed() {
return loginConfiguration.isGuestLoginAllowed();
}
}
13 changes: 13 additions & 0 deletions src/main/resources/buildServerResources/loginViaOAuth.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,25 @@
.loginForm {
display: none;
}
.oauth-guest-section {
text-align: right;
padding-top: 0.5em;
}
</style>
</c:if>
<div>
<form action="<c:url value='${oauthLoginUrl}'/>" method="GET">
<input class="btn loginButton" style="margin: auto; display: block" type="submit" name="submitLogin"
value="Log in via oAuth">
<c:if test="${oauth2_settings.hideLoginForm and oauth2_settings.guestLoginAllowed}">
<div class="oauth-guest-section">
<span class="greyNote">
<a href="<c:url value='/guestLogin.html?guest=1'/>">Log in as guest</a>&nbsp;
<bs:help file="User+Account"/>
</span>
</div>
</c:if>
</form>
</div>
</c:if>

0 comments on commit a9df953

Please sign in to comment.