Skip to content

Commit

Permalink
fix: fix authentication dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Feb 5, 2019
1 parent 81def84 commit 782022e
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions src/authenticate.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,27 @@ function authenticate() {
if (Cookies.get('cwrc-token')) {
return true
} else {

$(document.body).append($.parseHTML(
`<div id="githubAuthenticateModal" class="modal fade">
`<div id="githubAuthenticateModal" class="modal" style="display: block;">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div id="menu" class="modal-body">
<div style="margin-bottom:2em">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="float:right"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></button>
<h4 id="gh-modal-title' class="modal-title" style="text-align:center">Authenticate with Github</h4>
<h4 id="gh-modal-title' class="modal-title" style="text-align:center">Authenticate with GitHub</h4>
</div>
<div style="margin-top:1em">
<div id="cwrc-message" style="margin-top:1em">
You must first authenticate through Github to allow the CWRC-Writer
to make calls on your behalf. CWRC does not keep any of your github
information. The github token issued by github is not stored on a
CWRC-Server, but is only submitted as a jwt token for each request
you make. If you are looking for a version of the CWRC-Writer that
does not use Github to store documents, please try our other sandbox:
<a href="http://apps.testing.cwrc.ca/editor/dev/editor_dev.htm">
CWRC-Writer Simple Sandbox
</a>
<p>You must first authenticate through GitHub to allow the CWRC-GitWriter
to make calls on your behalf.</p><p>CWRC does not keep any of your GitHub
information. The GitHub token issued by GitHub is not stored on a CWRC server,
but is only submitted as a <a href="https://jwt.io/" rel="noopener noreferrer" target="_blank">JSON Web Token</a>
for each request you make.</p>
</div>
</div>
<div style="text-align:center;margin-top:3em;margin-bottom:3em" id="git-oath-btn-grp">
<div class="input-group" >
<div class="input-group-btn" >
<button type="button" id="git-oauth-btn" class="btn btn-default">Authenticate with Github</button>
<button type="button" id="git-oauth-btn" class="btn btn-success">Authenticate with GitHub</button>
</div>
</div> <!--input group -->
</div>
Expand All @@ -57,12 +51,6 @@ function authenticate() {
window.location.href = "/github/authenticate";
});

$('#githubAuthenticateModal').modal('show').on('shown.bs.modal', function () {
$(".modal").css('display', 'block');
}).on('hidden.bs.modal', function() {
$(this).remove()
})

return false
}

Expand Down

0 comments on commit 782022e

Please sign in to comment.