Skip to content

Commit

Permalink
signup page, add collection list
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Aug 23, 2019
1 parent 3cca1b4 commit 8430395
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions apps/signup/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
var userSignupUrl = "../../data/Auth/post"
function addUser(){
var email = document.getElementById("name").value
var collections = document.getElementById("collections").value
var attr = document.querySelector('input[name="attr"]:checked').value
var attr_doc = []
if (attr == "admin"){
Expand All @@ -23,7 +24,7 @@
if (attr == "editor"){
attr_doc = ["write"]
}
var doc = {name: email, attrs: attr_doc}
var doc = {name: email, attrs: attr_doc, :collections}
fetch(userSignupUrl, {
method: 'POST',
mode: 'cors', // no-cors, cors, *same-origin
Expand Down Expand Up @@ -57,6 +58,10 @@ <H1>User Signup</H1>
<input id="name" type="text" >
<span data-placeholder="Email">
</div>
<div class="txtc">
<input id="collections" type="text" >
<span data-placeholder="['list','of','collections']">
</div>

<div class="radb">
<!-- User Type selection -->
Expand All @@ -74,13 +79,13 @@ <H1>User Signup</H1>
</div>
<!-- submit btn -->
<input id="sub" class="sub-btn" onclick="addUser()" type="submit">

<!-- <div class="bottom-text">
Don't have account?
</div> -->

<div class="login-tips">If you reach this page, it's likely that you tried to log into this instance but lack access.
Email SOMEONE if you want to be added. If you are an admin, you should be able to use this form.</div>
Email the administrator if you want to be added. If you are an admin, you should be able to use this form.</div>
</div>
<script type="text/javascript">
const input_name = document.querySelector('#name');
Expand Down
3 changes: 2 additions & 1 deletion login.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
document.cookie = cookie_name + "=" + x.token;
window.location = state
} else {
window.alert("no!")
window.alert("User not added")
window.location = "./apps/signup/signup"
}

})
Expand Down

0 comments on commit 8430395

Please sign in to comment.