Initial commit
This commit is contained in:
commit
35745a89ec
44 changed files with 3342 additions and 0 deletions
44
client/Accounts/Login/login.js
Normal file
44
client/Accounts/Login/login.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { SysConfig } from '../../../imports/api/systemConfig';
|
||||
|
||||
Template.login.onCreated(function() {
|
||||
this.subscribe("SystemConfig");
|
||||
});
|
||||
|
||||
Template.login.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.login.helpers({
|
||||
areFilled: function() {
|
||||
return Session.get("filledFields");
|
||||
},
|
||||
canReg: function() {
|
||||
let conf = SysConfig.findOne();
|
||||
if (typeof conf != 'undefined') {
|
||||
return conf.allowReg;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Template.login.events({
|
||||
'click #logmein' (event) {
|
||||
event.preventDefault();
|
||||
console.log("clicked login");
|
||||
let email = $("#email").val();
|
||||
let pass = $("#password").val();
|
||||
|
||||
if (email == null || email == "" || pass == "" || pass == null) {
|
||||
Session.set("filledFields", false);
|
||||
return;
|
||||
} else {
|
||||
Meteor.loginWithPassword(email, pass);
|
||||
}
|
||||
},
|
||||
'click #reg' (event) {
|
||||
event.preventDefault();
|
||||
FlowRouter.go('/reg');
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue