Files
AVEF/imports/startup/both/accounts.js

90 lines
2.4 KiB
JavaScript

import { AccountsTemplates } from 'meteor/useraccounts:core';
AccountsTemplates.configure({
enablePasswordChange: true, //Allow the user to change their password via the login UI.
forbidClientAccountCreation: true, //Turn off client side account creation. The app is expected to have a feature that will do this.
showForgotPasswordLink: true,
defaultTemplate: 'OverrideAtForm',
//defaultTemplate: 'AuthorizationPage', //The template for all the forms related to logging in or out.
defaultLayout: 'Login', //What Admin template to place the defaultTemplate in.
defaultContentRegion: 'content', //The content region of the Admin template to place the defaultTemplate in.
defaultLayoutRegions: {},
// defaultLayout: 'Body',
// defaultContentRegion: 'content',
// defaultLayoutRegions: {}
homeRoutePath: '/Admin/Internships', //The path where the user is taken after logging in successfully. Unfortunately this is also used for the path when logging out, so we must override that function with an onLogoutHook.
onLogoutHook: function() {
FlowRouter.go("/");
},
texts: {
title: {
signIn: ""
},
button: {
signIn: "Enter"
}
}
});
// This removes the password field but returns it,
// so that you can re-add it later, preserving the
// desired order of the fields
// let pwd = AccountsTemplates.removeField('password');
// AccountsTemplates.removeField('email');
// AccountsTemplates.addFields([
// {
// _id: "username",
// type: "text",
// displayName: "username",
// required: true,
// minLength: 5,
// },
// pwd
// ]);
let pwd = AccountsTemplates.removeField('password');
AccountsTemplates.removeField('email');
AccountsTemplates.addFields([
{
_id: "username",
type: "text",
displayName: "username",
required: true,
minLength: 5,
},
{
_id: 'email',
type: 'email',
required: true,
displayName: "email",
re: /.+@(.+){2,}\.(.+){2,}/,
errStr: 'Invalid email',
},
{
_id: 'username_and_email',
type: 'text',
required: true,
displayName: "Login",
placeholder: "Login / Email"
},
pwd
]);
//AccountsTemplates.configureRoute('signIn', {
// name: 'signin',
// path: '/Admin/SignIn'
//});
//// AccountsTemplates.configureRoute('signUp', {
//// name: 'join',
//// path: '/join'
//// });
//AccountsTemplates.configureRoute('forgotPwd', {
// name: 'forgotPwd',
// path: '/Admin/ForgotPwd'
//});
//AccountsTemplates.configureRoute('resetPwd', {
// name: 'resetPwd',
// path: '/Admin/ResetPwd'
//});