mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
44 lines
No EOL
1.1 KiB
JavaScript
44 lines
No EOL
1.1 KiB
JavaScript
import { SysConfig } from '../../../imports/api/systemConfig.js';
|
|
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
|
|
|
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');
|
|
},
|
|
}); |