Skip to content

Commit

Permalink
📝 fetching email id in js
Browse files Browse the repository at this point in the history
  • Loading branch information
josephv7 committed Oct 28, 2018
1 parent ea4f5d5 commit 380b310
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 11 additions & 11 deletions .firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
83682df64894ae8d103a.bundle.js,1540754051807,9e3eb750813de7b86ac46c1bdfc041e4dee4b83503ca026eb5b44da3c66fc1b0
83682df64894ae8d103a.bundle.js.map,1540754051806,c9003510ac495db0bb3b2ca7ff950cc155b693c92eecc2de379f79fc01963b57
login.css,1540754051806,b08b1b0d5f41384bb1a8b5318aa99e9a8394a0c49d37fb7cf115f33abe860556
main.css,1540754051807,46afdea36a7b50d9215e2e71c835aed7ddad9039f5f42f722038ab92b1ac2be8
login.html,1540754051806,8e48bd69f6cddeea849a51165bbedd955507476054f3339528a1125b371e0470
precache-manifest.9a02a9c2a3720181970d88ec7d71a67e.js,1540754051807,53531ebf6087ae885055722a7100f72a9ebb5d423db681caaa8a6a0e3e6ac5ff
registration.css,1540754051807,1ec68dd1a1bc4e25685a8fea335c13a50ecea903056bb152925ff48736fb44dd
index.html,1540754051806,63cdeba2843a3cd51bd8455fa1d1cd77c2abc5d7f0c5f32f35049e89f38c6f32
sw.js,1540754051807,a2a9923b915cf3b8f70c50ca48484bcfec7cc44eeef0913a79cde5b331386195
registration.html,1540754051806,4b4ff1a0a3635e86fd1a61d318b79a221919cccc8a8d77237889bda672458d49
sketch.js,1540754056905,e47e7727c3f6482b86f7c925c36328764661f4be214e0f516a88d4690619c27e
77be63d72c1e85fc267c.bundle.js,1540755148495,895d3ce0113e97b980afca2cc37a497e644e00849412b3a47b937f01d2fc288a
77be63d72c1e85fc267c.bundle.js.map,1540755148495,4bea57c6e5a5d2fa7ce164a200a6dcc746505dc1f03f2ac602d61f11bc0e74cc
login.css,1540755148494,b08b1b0d5f41384bb1a8b5318aa99e9a8394a0c49d37fb7cf115f33abe860556
login.html,1540755148494,1675701c66d5312a6bad7a0da5c0b29b21bf87f1a043bbc63d7cef0718d5e317
main.css,1540755148495,46afdea36a7b50d9215e2e71c835aed7ddad9039f5f42f722038ab92b1ac2be8
precache-manifest.e2842d33eca775a938d265d0851cf8b0.js,1540755148494,fbf7af9ec82116bcae20dca5e8948d1553ecc236bbdc1436d4601f5536dac38e
index.html,1540755148494,c15ed2e8724183f7e77bffde5653ee28cfe2048b68d7d011f205e5a8bdcdf9a7
registration.css,1540755148494,1ec68dd1a1bc4e25685a8fea335c13a50ecea903056bb152925ff48736fb44dd
registration.html,1540755148494,f97e2552ca7487beb30be3f93fb4a47054d3f4ab842fcd68883835378cc75498
sw.js,1540755148495,1978b49a25e34739cc7d7371d41190201fb3a523e3dd6575769375b0a61755b6
sketch.js,1540755160785,e47e7727c3f6482b86f7c925c36328764661f4be214e0f516a88d4690619c27e
8 changes: 6 additions & 2 deletions src/registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h1 style="font-family: 'Titillium Web', bold; margin-left:10%;">Registration</h
</li>
<li>
<label for="house" style="font-family: 'Titillium Web', sans-serif;"> House *</label>
<input id="house" name="house" required placeholder="House" style="font-family: 'Titillium Web', bold; color: black;" />
<input id="house" name="house" required placeholder="House" style="font-family: 'Titillium Web', bold; color: black;" disabled/>
</li>

<li>
Expand Down Expand Up @@ -77,6 +77,7 @@ <h1 style="font-family: 'Titillium Web', bold; margin-left:10%;">Registration</h
</select>

</li>

<div class="col-md-3 text-center">
<button type="submit" class="btn btn-lg btn-success">Submit</button>
</div>
Expand Down Expand Up @@ -129,17 +130,20 @@ <h2 style="font-family: 'Titillium Web', bold;font-weight: 300; text-align:cente
});
});

var house, uid;
var house, uid, email;
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
uid = firebase.auth().currentUser.uid;
email = firebase.auth().currentUser.email;
console.log(uid);
console.log(email);
console.log('here2');

firebase.database().ref().child('reg_captains').once("value",function(snapshot){
console.log('here');
var house = snapshot.child(uid).val();
console.log(house);
document.getElementById('house').value = house;
})

} else {
Expand Down

0 comments on commit 380b310

Please sign in to comment.