LT-196: Verify user's email on signup
This commit is contained in:
1 parent
ee8fb5492c
commit
813c68881a
11 files changed
+110
-14
No files matched your search
@@ -0,0 +1,8 @@
|
||||
<template name="emailVerification">
|
||||
<div id="emailVerification">
|
||||
<div id="emailVerificationContent">
|
||||
<h3>Verify Your Email Address</h3>
|
||||
<p>We need to verify your email address. We've sent an email to <b>{{emailAddress}}</b> to verify your address. Please click the link in your email to continue.</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,5 @@
|
||||
Template.emailVerification.helpers({
|
||||
emailAddress: function() {
|
||||
return Meteor.user().emails[0].address;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
#emailVerification
|
||||
#emailVerificationContent
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
margin: auto
|
||||
width: 60%
|
||||
height: 20%
|
||||
z-index: 100
|
||||
border-radius: 5px
|
||||
padding: 10px 20px 10px 20px
|
||||
background-color: rgba(255,255,255,1)
|
||||
outline: none
|
||||
@@ -263,10 +263,13 @@ Template.viewer.onCreated(function() {
|
||||
});
|
||||
|
||||
// Set active tool for timepoint
|
||||
dataContext.timepointIds.forEach(function(timepointId) {
|
||||
var timepoint = Timepoints.findOne({timepointId: timepointId});
|
||||
setTimepointActiveTool(timepoint);
|
||||
});
|
||||
if (dataContext && dataContext.timepointIds) {
|
||||
dataContext.timepointIds.forEach(function(timepointId) {
|
||||
var timepoint = Timepoints.findOne({timepointId: timepointId});
|
||||
setTimepointActiveTool(timepoint);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
Session.setDefault('ViewerData', {});
|
||||
|
||||
// TODO: verifyEmail variable will be removed when mail server is set.
|
||||
// verifyEmail controls email verification template
|
||||
// set verifyEmail as false if email server settings are not ready
|
||||
Session.setDefault('verifyEmail', false);
|
||||
|
||||
// Re-add any tab data saved in the Session
|
||||
Object.keys(ViewerData).forEach(function(contentId) {
|
||||
var tabData = ViewerData[contentId];
|
||||
@@ -29,21 +34,33 @@ var routerOptions = {
|
||||
data: data
|
||||
};
|
||||
|
||||
|
||||
|
||||
Router.route('/', function() {
|
||||
// Check user is logged in
|
||||
if (!Meteor.user() || !Meteor.userId()) {
|
||||
this.render('entrySignIn', routerOptions);
|
||||
if(Meteor.user() && Meteor.userId()) {
|
||||
if (!Meteor.user().emails[0].verified && Session.get("verifyEmail")) {
|
||||
this.render('emailVerification', routerOptions);
|
||||
} else {
|
||||
this.render('worklist', routerOptions);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.render('worklist', routerOptions);
|
||||
this.render('entrySignIn', routerOptions);
|
||||
}
|
||||
});
|
||||
|
||||
Router.route('/worklist', function() {
|
||||
// Check user is logged in
|
||||
if (!Meteor.user() || !Meteor.userId()) {
|
||||
this.render('entrySignIn', routerOptions);
|
||||
if(Meteor.user() && Meteor.userId()) {
|
||||
if (!Meteor.user().emails[0].verified && Session.get("verifyEmail")) {
|
||||
this.render('emailVerification', routerOptions);
|
||||
} else {
|
||||
this.render('worklist', routerOptions);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.render('worklist', routerOptions);
|
||||
this.render('entrySignIn', routerOptions);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user