Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Use $location.path() to navigate between pages #188

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions dist/stormpath-sdk-angularjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* stormpath-sdk-angularjs
* Copyright Stormpath, Inc. 2016
*
* @version v1.1.0-dev-2016-08-17
* @version v1.1.0-dev-2016-10-24
* @link https://github.com/stormpath/stormpath-sdk-angularjs
* @license Apache-2.0
*/
Expand Down Expand Up @@ -3183,14 +3183,9 @@ angular.module('stormpath.userService',['stormpath.CONFIG'])
* verified and can be used for login. If rejected the token is expired
* or has already been used.
*
* @param {Object} data Data object
* @param {String} sptoken
*
* An object literal for passing the email verification token.
* Must follow this format:
* ```
* {
* sptoken: '<token from email>'
* }```
* The value of the `sptoken` that was sent by email to the user
*
* @description
*
Expand Down
2 changes: 1 addition & 1 deletion dist/stormpath-sdk-angularjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/stormpath-sdk-angularjs.tpls.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* stormpath-sdk-angularjs
* Copyright Stormpath, Inc. 2016
*
* @version v1.1.0-dev-2016-08-17
* @version v1.1.0-dev-2016-10-24
* @link https://github.com/stormpath/stormpath-sdk-angularjs
* @license Apache-2.0
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/stormpath-sdk-angularjs.tpls.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/spEmailVerification.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<p ng-show="verifying" class="alert alert-warning">We are verifying your account</p>
<p ng-show="verified" class="alert alert-success">
Your account has has been verified!
<a href="/login">Login Now.</a>
<a href="" ng-click="login()">Login Now.</a>
</p>
<p ng-show="reVerificationSent" class="alert alert-success">
We have sent a new verification message to your email address, please check your email for this message.
Expand All @@ -25,7 +25,7 @@
<div class="form-group">
<label for="spEmail" class="col-xs-12 col-sm-4 control-label">Email or Username</label>
<div class="col-xs-12 col-sm-4">
<input class="form-control" id="spUsername" ng-model="formModel.username" placeholder="Username or Email" ng-disabled="posting">
<input class="form-control" id="spEmail" ng-model="formModel.username" placeholder="Username or Email" ng-disabled="posting">
</div>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion src/spLoginForm.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<div class="col-sm-offset-4 col-sm-4">
<p class="text-danger" ng-show="error" ng-bind="error"></p>
<button type="submit" class="btn btn-primary" ng-disabled="posting">Login</button>
<a href="/forgot" class="pull-right">Forgot Password</a>
<a href="" ng-click="forgot()" class="pull-right">Forgot Password</a>
</div>
</div>
<div class="form-group" ng-show="viewModel.accountStores.length">
Expand Down
12 changes: 6 additions & 6 deletions src/spPasswordResetForm.tpl.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="row">
<div class="col-sm-offset-4 col-xs-12 col-sm-4">
<p ng-show="verifying" class="alert alert-warning text-center">We are verifying this link</p>
<p class="alert alert-success" ng-show="reset">Your new password has been set. Please <a href="/login">Login Now</a>.</p>
<p class="alert alert-success" ng-show="reset">Your new password has been set. Please <a href="" ng-click="login()">Login Now</a>.</p>
<div ng-show="showVerificationError" class="alert alert-danger">
This password reset link is not valid. You may request another
link by <a href="/forgot">clicking here</a>.
link by <a href="" ng-click="forgot()">clicking here</a>.
</div>
</div>
</div>
Expand All @@ -13,15 +13,15 @@
<form class="form-horizontal" ng-show="verified && !reset" ng-submit="submit()">

<div class="form-group">
<label for="spEmail" class="col-xs-12 col-sm-4 control-label">New Password</label>
<label for="spNewPassword" class="col-xs-12 col-sm-4 control-label">New Password</label>
<div class="col-xs-12 col-sm-4">
<input class="form-control" id="spUsername" ng-model="formModel.password" placeholder="New Password" type="password" ng-disabled="posting">
<input class="form-control" id="spNewPassword" ng-model="formModel.password" placeholder="New Password" type="password" ng-disabled="posting">
</div>
</div>
<div class="form-group">
<label for="spEmail" class="col-xs-12 col-sm-4 control-label">Confirm New Password</label>
<label for="spConfirmPassword" class="col-xs-12 col-sm-4 control-label">Confirm New Password</label>
<div class="col-xs-12 col-sm-4">
<input class="form-control" id="spUsername" ng-model="formModel.confirmPassword" placeholder="Confirm New Password" type="password" ng-disabled="posting">
<input class="form-control" id="spConfirmPassword" ng-model="formModel.confirmPassword" placeholder="Confirm New Password" type="password" ng-disabled="posting">
</div>
</div>
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion src/spPasswordResetRequestForm.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Please check your email for this message, then click on the link.
</p>
<p ng-show="sent" class="pull-right">
<a href="/login">Back to Login</a>
<a href="" ng-click="login()">Back to Login</a>
</p>
<div ng-show="error" class="alert alert-danger" ng-bind="error"></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/spRegistrationForm.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
<div class="col-sm-offset-4 col-xs-12 col-sm-4">
<p class="alert alert-success" ng-show="created && !enabled">Your account has been created. Please check your email for a verification link.</p>
<p ng-show="created && !enabled" class="pull-right">
<a href="/login">Back to Login</a>
<a href="" ng-click="login()">Back to Login</a>
</p>
<p class="alert alert-success" ng-show="created && enabled && !authenticating">Your account has been created. <a href="/login">Login Now</a>.</p>
<p class="alert alert-success" ng-show="created && enabled && !authenticating">Your account has been created. <a href="" ng-click="login()">Login Now</a>.</p>
</div>
</div>
<div class="row">
Expand Down Expand Up @@ -70,4 +70,4 @@
</div>
</form>
</div>
</div>
</div>
3 changes: 3 additions & 0 deletions src/stormpath.emailverification.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ angular.module('stormpath')
$scope.posting = false;
});
};
$scope.login = function(){
$location.path('/login')
};
}])

/**
Expand Down
5 changes: 4 additions & 1 deletion src/stormpath.login.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

angular.module('stormpath')

.controller('SpLoginFormCtrl', ['$scope','$auth','$viewModel',function ($scope,$auth,$viewModel) {
.controller('SpLoginFormCtrl', ['$scope','$auth','$location','$viewModel',function ($scope,$auth,$location,$viewModel) {
$scope.viewModel = null;

$viewModel.getLoginModel().then(function (model) {
Expand Down Expand Up @@ -30,6 +30,9 @@ angular.module('stormpath')
$scope.error = err.message;
});
};
$scope.forgot = function(){
$location.path('/forgot')
};
}])


Expand Down
12 changes: 10 additions & 2 deletions src/stormpath.passwordreset.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

angular.module('stormpath')
.controller('SpPasswordResetRequestCtrl', ['$scope','$user',function ($scope,$user) {
.controller('SpPasswordResetRequestCtrl', ['$scope','$location','$user',function ($scope,$location,$user) {
$scope.sent = false;
$scope.posting = false;
$scope.formModel = {
Expand All @@ -21,6 +21,12 @@ angular.module('stormpath')
$scope.posting = false;
});
};
$scope.forgot = function(){
$location.path('/forgot');
};
$scope.login = function(){
$location.path('/login');
};
}])

.controller('SpPasswordResetCtrl', ['$scope','$location','$user',function ($scope,$location,$user) {
Expand Down Expand Up @@ -71,7 +77,9 @@ angular.module('stormpath')
$scope.posting = false;
});
};

$scope.login = function(){
$location.path('/login');
};
}])

/**
Expand Down
5 changes: 4 additions & 1 deletion src/stormpath.registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ angular.module('stormpath')
$scope.error = err.message;
});
};
$scope.login = function(){
$location.path('/login');
};
}])


Expand Down Expand Up @@ -177,4 +180,4 @@ angular.module('stormpath')
scope.postLoginState = attrs.postLoginState || '';
}
};
});
});