mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-06 19:26:57 +02:00
Make emails unique
Emails are made unique. When user attempts to sign in through a provider in which his email is one that is already registered, user is redirected to the signin page with an error passed as a query string parameter.
This commit is contained in:
@@ -36,7 +36,7 @@ angular.module('users').config(['$stateProvider',
|
||||
templateUrl: 'modules/users/views/authentication/signup.client.view.html'
|
||||
}).
|
||||
state('authentication.signin', {
|
||||
url: '/signin',
|
||||
url: '/signin?err',
|
||||
templateUrl: 'modules/users/views/authentication/signin.client.view.html'
|
||||
}).
|
||||
state('password', {
|
||||
|
||||
@@ -4,6 +4,9 @@ angular.module('users').controller('AuthenticationController', ['$scope', '$http
|
||||
function($scope, $http, $location, Authentication) {
|
||||
$scope.authentication = Authentication;
|
||||
|
||||
// Get an eventual error defined in the URL query string:
|
||||
$scope.error = $location.search().err;
|
||||
|
||||
// If user is signed in then redirect back home
|
||||
if ($scope.authentication.user) $location.path('/');
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
or
|
||||
<a data-ui-sref="authentication.signup">Sign up</a>
|
||||
</div>
|
||||
<div class="forgot-password">
|
||||
<div class="text-center forgot-password">
|
||||
<a data-ui-sref="password.forgot">Forgot your password?</a>
|
||||
</div>
|
||||
<div data-ng-show="error" class="text-center text-danger">
|
||||
<strong data-ng-bind="error"></strong>
|
||||
</div>
|
||||
<alert type="danger" data-ng-show="error" class="text-center text-danger">
|
||||
<span data-ng-bind="error"></span>
|
||||
</alert>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user