mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
APIv2: add paths /api/v2/* and /api/v1/*. v1 has limited deprecated routes (only the things I know currently work), and we'll notify 3rd-partyists to migrate to apiv2 once it's documented and tested
This commit is contained in:
@@ -37,7 +37,7 @@ habitrpg.controller("AuthCtrl", ['$scope', '$rootScope', 'User', '$http', '$loca
|
||||
if ($scope.registrationForm.$invalid) {
|
||||
return;
|
||||
}
|
||||
$http.post(API_URL + "/api/v1/register", $scope.registerVals).success(function(data, status, headers, config) {
|
||||
$http.post(API_URL + "/api/v2/register", $scope.registerVals).success(function(data, status, headers, config) {
|
||||
runAuth(data.id, data.apiToken);
|
||||
}).error(function(data, status, headers, config) {
|
||||
if (status === 0) {
|
||||
@@ -68,7 +68,7 @@ habitrpg.controller("AuthCtrl", ['$scope', '$rootScope', 'User', '$http', '$loca
|
||||
if ($scope.useUUID) {
|
||||
runAuth($scope.loginUsername, $scope.loginPassword);
|
||||
} else {
|
||||
$http.post(API_URL + "/api/v1/user/auth/local", data)
|
||||
$http.post(API_URL + "/api/v2/user/auth/local", data)
|
||||
.success(function(data, status, headers, config) {
|
||||
runAuth(data.id, data.token);
|
||||
}).error(errorAlert);
|
||||
@@ -84,7 +84,7 @@ habitrpg.controller("AuthCtrl", ['$scope', '$rootScope', 'User', '$http', '$loca
|
||||
}
|
||||
|
||||
$scope.passwordReset = function(email){
|
||||
$http.post(API_URL + '/api/v1/user/reset-password', {email:email})
|
||||
$http.post(API_URL + '/api/v2/user/reset-password', {email:email})
|
||||
.success(function(){
|
||||
alert('New password sent.');
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user