Skip to content

Commit

Permalink
Error saml improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
apozohue10 committed Sep 20, 2019
1 parent 097ce38 commit 876cf82
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 12 deletions.
2 changes: 1 addition & 1 deletion controllers/saml2/saml2.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ exports.saml2_application_login = function(req, res) {
return req.sp.post_assert(idp, options, function(error, saml_response) {
if (error != null) {
res.locals.error = error;
res.render('errors/saml');
return res.render('errors/saml', { application: req.application });
}

// Save name_id and session_index for logout
Expand Down
55 changes: 44 additions & 11 deletions views/errors/saml.ejs
Original file line number Diff line number Diff line change
@@ -1,13 +1,46 @@
<div class="error">
<h1>Saml2 request has failed!</h1>
<div class="error-saml">
<p><b>error - </b>
<% if (error.message) { -%>
<%= error.message %>
<% } else { -%>
internal error
<% } -%>
</p>
<p>you can check your application configuration in <a href='/idm'>Homepage</a></p>
<h1>ops! something went wrong!</h1>
<p>contact with the administrators of
<% if (application) { -%>
<a href="<%= application.url%>"> <%= application.name %></a>
<% } else { -%>
your web service provider
<% } -%>
and send your
<a data-toggle="collapse" href="#error_saml" aria-expanded="true" aria-controls="error_saml" class="collapsed">
error details <i class="fa fa-angle-up"></i>
</a>
</p>
<div class="collapse_out">
<div id="error_saml" class="form-group collapse" role="tabpanel">
<h2>Saml2 request has failed!</h2>
<p><b>error - </b>
<% if (error.message) { -%>
<%= error.message %>
<% } else { -%>
internal error
<% } -%>
</p>
</div>
</div>
</div>
</div>

<script type="text/javascript">
$('.collapsed').mouseover(function(){
$(this).children('i').toggleClass('fa-rotate-180');
});
$('.collapsed').mouseleave(function(){
if ($(this).hasClass('collapsed')){
$(this).children('i').removeClass('fa-rotate-180');
} else {
$(this).children('i').addClass('fa-rotate-180');
}
});
$('.collapsed').click(function(){
if ($(this).hasClass('collapsed')){
$(this).children('i').addClass('fa-rotate-180');
} else {
$(this).children('i').removeClass('fa-rotate-180');
}
});
</script>

0 comments on commit 876cf82

Please sign in to comment.