fixed logout bug

This commit is contained in:
David Baldwynn 2016-08-25 16:33:10 -07:00
parent 6af807491b
commit 5f58f7b8ad
18 changed files with 209 additions and 256 deletions

View file

@ -46,19 +46,19 @@ var UserSchema = new Schema({
type: String,
trim: true,
default: '',
validate: {
/*validate: {
validator: validateLocalStrategyProperty,
message: 'Please fill in your first name'
}
}*/
},
lastName: {
type: String,
trim: true,
default: '',
validate: {
/*validate: {
validator: validateLocalStrategyProperty,
message: 'Please fill in your last name'
}
}*/
},
email: {
type: String,

View file

@ -34,6 +34,8 @@
<link href="/static/modules/core/img/brand/favicon.ico" rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<link rel="stylesheet" href="/static/lib/bootstrap/dist/css/bootstrap.min.css">
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900'>
<!--Bower CSS dependencies-->
{% for bowerCssFile in bowerCssFiles %}
<link rel="stylesheet" href="{{bowerCssFile}}">
@ -66,7 +68,6 @@
<a href="https://github.com/whitef0x0/tellform">Fork me on GitHub</a>
</div>
</div>-->
<header data-ng-include="'/static/modules/core/views/header.client.view.html'"></header>
{% block content %}{% endblock %}
<script src="/static/lib/file-saver.js/FileSaver.js" type="text/javascript"></script>

View file

@ -15,7 +15,10 @@ module.exports = function() {
},
function(username, password, done) {
User.findOne({
username: username
$or: [
{ "username": username},
{ "email": username}
]
}, function(err, user) {
if (err) {
return done(err);

View file

@ -30,9 +30,12 @@ angular.module('core').controller('HeaderController', ['$rootScope', '$scope', '
Auth.ensureHasCurrentUser(User);
$scope.user = $rootScope.user = null;
$state.go('listForms');
//Refresh view
$state.reload();
},
function(reason) {
console.log('Logout Failed: ' + reason);
console.error('Logout Failed: ' + reason);
});
};

View file

@ -1,67 +1,47 @@
body {
overflow-x: hidden;
font-family: 'Source Sans Pro', sans-serif;
font-size: 16px;
}
section.content {
padding-top: 5em;
.vcenter {
display: inline-block;
vertical-align: middle;
float: none;
}
/*Navbar Custom CSS*/
.navbar {
min-height: 60px;
}
.navbar-inverse {
background-color:#588EB4;
border: 0;
color: white!important;
}
.navbar .navbar-brand {
font-size: 1.6em;
font-weight: 900;
.navbar li > * {
border-bottom: 4px solid white;
color: white;
}
.navbar .navbar-brand:hover, .navbar .navbar-brand:visited {
color: #ddd;
.navbar li:hover > * {
border-bottom: 2px solid #ddd;
}
.navbar-inverse .navbar-nav>li>a {
color: white;
}
.navbar li.dropdown a.dropdown-toggle:hover > *{
color: #f9f9f9;
}
.navbar li.dropdown a.dropdown-toggle > *{
color: #ddd;
}
.navbar .navbar-brand span {
text-decoration: underline;
}
.nav.navbar-nav.navbar-right li {
padding-right: 20px;
}
.navbar-inverse .navbar-nav>li>a, .navbar li.dropdown a.dropdown-toggle > * {
color: #ddd;
}
.navbar-inverse .navbar-nav .active > a, .navbar li.dropdown.open a.dropdown-toggle > *, .navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover {
background-color: #6450A0;
color: #ddd;
}
.navbar-inverse .navbar-toggle {
background-color: #ddd;
border:none;
}
.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus {
color: white;
}
.navbar-inverse .navbar-collapse{
border: none;
}
.undecorated-link:hover {
text-decoration: none;
}
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
.browsehappy.jumbotron.hide,
body.ng-cloak
{
display: block;
}
/*Hero Section CSS (for /home)*/
section.hero-section {

View file

@ -1,114 +0,0 @@
/* columns of same height styles */
.row-height {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
}
.col-height {
display: table-cell;
float: none;
height: 100%;
}
.col-top {
vertical-align: top;
}
.col-middle {
vertical-align: middle;
}
.col-bottom {
vertical-align: bottom;
}
@media (min-width: 480px) {
.row-xs-height {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
}
.col-xs-height {
display: table-cell;
float: none;
height: 100%;
}
.col-xs-top {
vertical-align: top;
}
.col-xs-middle {
vertical-align: middle;
}
.col-xs-bottom {
vertical-align: bottom;
}
}
@media (min-width: 768px) {
.row-sm-height {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
}
.col-sm-height {
display: table-cell;
float: none;
height: 100%;
}
.col-sm-top {
vertical-align: top;
}
.col-sm-middle {
vertical-align: middle;
}
.col-sm-bottom {
vertical-align: bottom;
}
}
@media (min-width: 992px) {
.row-md-height {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
}
.col-md-height {
display: table-cell;
float: none;
height: 100%;
}
.col-md-top {
vertical-align: top;
}
.col-md-middle {
vertical-align: middle;
}
.col-md-bottom {
vertical-align: bottom;
}
}
@media (min-width: 1200px) {
.row-lg-height {
display: table;
table-layout: fixed;
height: 100%;
width: 100%;
}
.col-lg-height {
display: table-cell;
float: none;
height: 100%;
}
.col-lg-top {
vertical-align: top;
}
.col-lg-middle {
vertical-align: middle;
}
.col-lg-bottom {
vertical-align: bottom;
}
}

View file

@ -49,8 +49,8 @@
</li>
</ul>
</li>
<li ng-click="signout()">
<a>{{ 'SIGNOUT_TAB' | translate }}</a>
<li>
<a href='/' ng-click="signout()">{{ 'SIGNOUT_TAB' | translate }}</a>
</li>
</ul>
</nav>

View file

@ -1,3 +1,5 @@
<header data-ng-include="'/static/modules/core/views/header.client.view.html'"></header>
<div class="container" cg-busy="{promise:updatePromise,templateUrl:'modules/forms/admin/views/directiveViews/cgBusy/update-form-message-TypeB.html',message:'Updating form...', backdrop:false, wrapperClass:'.busy-updating-wrapper'}"></div>
<section class="container admin-form">

View file

@ -1,3 +1,5 @@
<header data-ng-include="'/static/modules/core/views/header.client.view.html'"></header>
<section class="overlay" ng-if="showCreateModal" ng-click="closeCreateModal()"></section>
<section data-ng-controller="ListFormsController as ctrl" data-ng-init="findAll()" class="container">

View file

@ -60,11 +60,11 @@ section.content p.breakwords {
word-break: break-all;
}
.btn {
.public-form .btn {
border: 1px solid #c6c6c6;
}
.btn[type='submit'] {
.public-form .btn[type='submit'] {
font-size: 1.5em;
padding: 0.35em 1.2em 0.35em 1.2em;
}
@ -82,7 +82,7 @@ section.content > section > section.container {
font-size: 18px;
font-weight: normal;
}
.input-block {
.public-form .input-block {
display: block;
width: 100%;
}
@ -116,7 +116,7 @@ div.form-fields {
position: relative;
padding-top: 35vh;
}
.letter {
.public-form .letter {
position: relative;
display: -moz-inline-stack;
display: inline-block;

View file

@ -4,7 +4,7 @@ angular.module('users').config(['$translateProvider', function ($translateProvid
$translateProvider.translations('en', {
ACCESS_DENIED_TEXT: 'You need to be logged in to access this page',
USERNAME_LABEL: 'Username',
USERNAME_LABEL: 'Username or Email',
PASSWORD_LABEL: 'Password',
CURRENT_PASSWORD_LABEL: 'Current Password',
NEW_PASSWORD_LABEL: 'New Password',
@ -15,8 +15,10 @@ angular.module('users').config(['$translateProvider', function ($translateProvid
LANGUAGE_LABEL: 'Language',
EMAIL_LABEL: 'Email',
SIGNUP_HEADER_TEXT: 'Sign up with your email',
SIGNIN_HEADER_TEXT: 'Sign in with your email or username',
SIGNUP_ACCOUNT_LINK: 'Don\'t have an account? Sign up here',
SIGN_IN_ACCOUNT_LINK: 'Already have an account? Sign in here',
SIGNUP_HEADER_TEXT: 'Sign up',
SIGNIN_HEADER_TEXT: 'Sign in',
SIGNUP_ERROR_TEXT: 'Couldn\'t complete registration due to errors',

View file

@ -1,6 +1,10 @@
section.auth {
margin-top: -5em;
padding-top: 5em;
padding: 70px 0;
position: absolute;
min-height: 100%;
top: 0;
left: 0;
width: 100%;
color: white;
background-color: #1e5799; /* Old browsers */
background: -moz-linear-gradient(137deg, #50B5C1 0%, #6450A0 85%); /* FF3.6-15 */
@ -8,19 +12,37 @@ section.auth {
background: linear-gradient(137deg, #50B5C1 0%, #6450A0 85%);
background: linear-gradient(137deg, #50B5C1 0%, #6450A0 85%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#50B5C1', endColorstr='#6450A0', GradientType=1); /* IE6-9 fallback on horizontal gradient */
}
section.auth > h3{
font-size: 3em;
font-size: 2em;
font-weight: 500;
}
.valign-wrapper {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-align-items: center;
-ms-flex-align: center;
align-items: center;
}
.valign-wrapper .valign {
display: block;
width: 100%;
}
section.auth a {
color: white;
text-decoration: underline;
}
section.auth.signup-view > h3 {
font-size: 4.4em;
font-size: 3em;
padding-bottom: 0.5em;
}
.row.auth form .field-input select {
section.auth form .field-input select {
padding: 0.45em 0.9em;
width: 100%;
background: transparent;
@ -29,6 +51,30 @@ section.auth {
height: 34px;
}
section.auth input {
color: #4c4c4c;
}
.btn {
border-radius: 100px;
font-size: 14px;
padding: 12px 28px;
margin-top: 1em;
text-transform: uppercase;
}
section.auth .btn-signup {
background-color: #FFD747;
color: #896D0B;
border: 2px #FFD747 solid;
width: 100%;
}
section.auth .btn-signup:hover {
color: #FFD747;
background-color: #896D0B;
border: 2px #896D0B solid;
}
@media (min-width: 992px) {
.nav-users {
position: fixed;
@ -44,3 +90,15 @@ section.auth {
position: absolute;
}
input.form-control {
border: none;
border-radius: 4px;
color: white;
box-shadow: none;
font-size: 18px;
padding: 30px 20px;
}
.btn {
border: none;
}

View file

@ -1,4 +1,4 @@
<section class="row text-center auth">
<section class="text-center auth">
<h3 class="col-md-12">{{ 'ACCESS_DENIED_TEXT' | translate }}</h3>
<a href="/#!/sigin" class="col-md-12">{{ 'SIGNIN_BTN' | translate }}</a>
</section>

View file

@ -1,5 +1,5 @@
<section class="row auth" data-ng-controller="AuthenticationController">
<h3 class="col-md-12 text-center">{{ 'SIGNIN_HEADER_TEXT' | translate }}</h3>
<section class="auth sigin-view valign-wrapper" data-ng-controller="AuthenticationController">
<!--<h3 class="col-md-12 text-center">{{ 'SIGNIN_HEADER_TEXT' | translate }}</h3>-->
<!-- <div class="col-md-12 text-center">
<a href="/auth/facebook" class="undecorated-link">
<img src="/modules/users/img/buttons/facebook.png">
@ -18,35 +18,41 @@
</a>
</div> -->
<!-- <h3 class="col-md-12 text-center">Or with your account</h3> -->
<div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6">
<form class="signin form-horizontal" autocomplete="off">
<fieldset>
<div data-ng-show="error" class="text-center text-danger">
Error: <strong data-ng-bind="error"></strong>
</div>
<div class="form-group">
<label for="username">{{ 'USERNAME_LABEL' | translate }}</label>
<input type="text" id="username" name="username" class="form-control" data-ng-model="credentials.username" placeholder="{{ 'USERNAME_LABEL' | translate }}" ng-pattern="languageRegExp" ng-minlength="4">
</div>
<div class="form-group">
<label for="password">{{ 'PASSWORD_LABEL' | translate }}</label>
<input type="password" id="password" name="password" class="form-control" data-ng-model="credentials.password" placeholder="{{ 'PASSWORD_LABEL' | translate }}">
</div>
<div class="forgot-password">
<a ui-sref="forgot">{{ 'FORGOT_PASSWORD_LINK' | translate }}</a>
<br>
<a ui-sref="verify">{{ 'REVERIFY_ACCOUNT_LINK' | translate }}</a>
</div>
<div class="text-center form-group">
<button class="btn btn-primary" ng-click="signin()">{{ 'SIGNIN_BTN' | translate }}</button>
<span ng-hide="$root.signupDisabled">
&nbsp; or&nbsp;
<a ui-sref="signup">{{ 'SIGNUP_BTN' | translate }}</a>
</span>
<div class="row valign">
<div class="col-md-4 col-md-offset-4">
<div class="col-md-12 text-center" style="padding-bottom: 50px;">
<img src="/static/modules/core/img/logo_white.svg" height="100px">
</div>
</fieldset>
</form>
</div>
<div class="col-md-12">
<form class="signin form-horizontal" autocomplete="off">
<fieldset>
<div data-ng-show="error" class="text-center text-danger">
Error: <strong data-ng-bind="error"></strong>
</div>
<div class="form-group">
<!--<label for="username">{{ 'USERNAME_LABEL' | translate }}</label>-->
<input type="text" id="username" name="username" class="form-control" data-ng-model="credentials.username" placeholder="{{ 'USERNAME_LABEL' | translate }}" ng-pattern="languageRegExp" ng-minlength="4">
</div>
<div class="form-group">
<!--<label for="password">{{ 'PASSWORD_LABEL' | translate }}</label>-->
<input type="password" id="password" name="password" class="form-control" data-ng-model="credentials.password" placeholder="{{ 'PASSWORD_LABEL' | translate }}">
</div>
<div class="form-group">
<button class="btn btn-signup" ng-click="signin()">{{ 'SIGNIN_BTN' | translate }}</button>
</div>
<div class="text-center forgot-password">
<a ui-sref="forgot">{{ 'FORGOT_PASSWORD_LINK' | translate }}</a>
</div>
</fieldset>
</form>
</div>
</div>
<div class="text-center forgot-password col-md-12">
<a ui-sref="signup">{{ 'SIGNUP_ACCOUNT_LINK' | translate }}</a>
</div>
</div>
</section>

View file

@ -1,4 +1,4 @@
<section class="row auth signup-view success" data-ng-controller="AuthenticationController">
<section class="auth signup-view success" data-ng-controller="AuthenticationController">
<!-- <h3 class="col-md-12 text-center">Sign up using your social accounts</h3>
<div class="col-md-12 text-center">
<a href="/auth/facebook" class="undecorated-link">

View file

@ -1,4 +1,4 @@
<section class="row auth signup-view" data-ng-controller="AuthenticationController">
<section class="auth signup-view valign-wrapper" data-ng-controller="AuthenticationController">
<!-- <h3 class="col-md-12 text-center">Sign up using your social accounts</h3>
<div class="col-md-12 text-center">
<a href="/auth/facebook" class="undecorated-link">
@ -17,54 +17,64 @@
<img src="/modules/users/img/buttons/github.png">
</a>
</div> -->
<h3 class="col-md-12 text-center">{{ 'SIGNUP_HEADER_TEXT' | translate }}</h3>
<div class="col-xs-offset-2 col-xs-8 col-md-offset-3 col-md-6">
<form name="userForm" data-ng-submit="signup()" class="signin form-horizontal" autocomplete="off">
<fieldset>
<div data-ng-show="error" id="signup_errors" class="text-center text-danger">
{{'SIGNUP_ERROR_TEXT' | translate}}: <br>
<strong data-ng-bind="error"></strong>
</div>
<div class="form-group">
<label for="firstName">{{ 'FIRST_NAME_LABEL' | translate }}</label>
<input type="text" ng-pattern="/^[a-zA-Z0-9 \-.]*$/" required id="firstName" name="firstName" class="form-control" ng-model="credentials.firstName" placeholder="First Name">
</div>
<div class="form-group">
<label for="lastName">{{ 'LAST_NAME_LABEL' | translate }}</label>
<input type="text" ng-pattern="/^[a-zA-Z0-9 \-.]*$/" required id="lastName" name="lastName" class="form-control" ng-model="credentials.lastName" placeholder="Last Name">
</div>
<div class="row form-group">
<div class="field-title">
<b>{{ 'LANGUAGE_LABEL' | translate }}</b>
<!--<h3 class="col-md-12 text-center">{{ 'SIGNUP_HEADER_TEXT' | translate }}</h3>-->
<div class="row valign">
<div class="col-md-12 text-center vcenter" style="padding-bottom: 50px;">
<img src="/static/modules/core/img/logo_white.svg" height="100px">
</div>
<div class="col-xs-offset-3 col-xs-6 col-sm-offset-4 col-sm-4">
<form name="userForm" data-ng-submit="signup()" class="signin form-horizontal" autocomplete="off">
<fieldset>
<div data-ng-show="error" id="signup_errors" class="text-center text-danger">
{{'SIGNUP_ERROR_TEXT' | translate}}: <br>
<strong data-ng-bind="error"></strong>
</div>
<div class="field-input">
<select ng-model="user.language" required>
<option ng-repeat="language in languages"
ng-selected="language == user.language"
value="{{language}}">
{{language}}
</option>
</select>
<!--<div class="form-group">
<label for="firstName">{{ 'FIRST_NAME_LABEL' | translate }}</label>
<input type="text" ng-pattern="/^[a-zA-Z0-9 \-.]*$/" required id="firstName" name="firstName" class="form-control" ng-model="credentials.firstName" placeholder="First Name">
</div>
</div>
<hr>
<div class="form-group">
<label for="username">{{ 'USERNAME_LABEL' | translate }}</label>
<input type="text" id="username" name="username" class="form-control" ng-pattern="languageRegExp" ng-minlength="4" ng-model="credentials.username" placeholder="Username">
</div>
<div class="form-group">
<label for="email">{{ 'EMAIL_LABEL' | translate }}</label>
<input type="email" id="email" name="email" class="form-control" ng-model="credentials.email" placeholder="Email">
</div>
<div class="form-group">
<label for="password">{{ 'PASSWORD_LABEL' | translate }}</label>
<input type="password" id="password" name="password" class="form-control" ng-model="credentials.password" placeholder="Password">
</div>
<div class="text-center form-group">
<button type="submit" class="btn btn-large btn-primary">{{ 'SIGNUP_BTN' | translate }}</button>
</div>
</fieldset>
</form>
<div class="form-group">
<label for="lastName">{{ 'LAST_NAME_LABEL' | translate }}</label>
<input type="text" ng-pattern="/^[a-zA-Z0-9 \-.]*$/" required id="lastName" name="lastName" class="form-control" ng-model="credentials.lastName" placeholder="Last Name">
</div>-->
<!--<div class="row form-group">
<div class="field-title">
<b>{{ 'LANGUAGE_LABEL' | translate }}</b>
</div>
<div class="field-input">
<select ng-model="user.language" required>
<option ng-repeat="language in languages"
ng-selected="language == user.language"
value="{{language}}">
{{language}}
</option>
</select>
</div>
</div>
<hr>-->
<div class="form-group">
<!--<label for="username">{{ 'USERNAME_LABEL' | translate }}</label>-->
<input type="text" id="username" name="username" class="form-control" ng-pattern="languageRegExp" ng-minlength="4" ng-model="credentials.username" placeholder="{{ 'USERNAME_LABEL' | translate }}">
</div>
<div class="form-group">
<!--<label for="email">{{ 'EMAIL_LABEL' | translate }}</label>-->
<input type="email" id="email" name="email" class="form-control" ng-model="credentials.email" placeholder="{{ 'EMAIL_LABEL' | translate }}">
</div>
<div class="form-group">
<!--<label for="password">{{ 'PASSWORD_LABEL' | translate }}</label>-->
<input type="password" id="password" name="password" class="form-control" ng-model="credentials.password" placeholder="{{ 'PASSWORD_LABEL' | translate }}">
</div>
<div class="text-center form-group">
<button type="submit" class="btn btn-signup">{{ 'SIGNUP_BTN' | translate }}</button>
</div>
</fieldset>
</form>
<div class="text-center forgot-password">
<a ui-sref="signin">{{ 'SIGN_IN_ACCOUNT_LINK' | translate }}</a>
</div>
</div>
</div>
</section>

View file

@ -1,4 +1,4 @@
<section class="auth row" data-ng-controller="VerifyController">
<section class="auth" data-ng-controller="VerifyController">
<section ng-if="!isResetSent">
<h3 class="col-md-12 text-center">Resend your account verification email</h3>
<p class="small text-center">Enter your account email.</p>

View file

@ -1,4 +1,4 @@
<section style="margin-top:50px;" class="row text-center" data-ng-controller="VerifyController" ng-init="validateVerifyToken()">
<section class="auth" data-ng-controller="VerifyController" ng-init="validateVerifyToken()">
<section class="row text-center" ng-if="isResetSent">
<h3 class="col-md-12"></h3>