mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 19:48:24 +00:00
22 lines
538 B
JavaScript
22 lines
538 B
JavaScript
|
|
'use strict';
|
||
|
|
|
||
|
|
// Make user and settings available for everyone through root scope.
|
||
|
|
habitrpg.controller('SettingsCtrl',
|
||
|
|
['$scope', 'User', '$location',
|
||
|
|
function($scope, User, $location) {
|
||
|
|
$scope.resetApp = function () {
|
||
|
|
localStorage.clear();
|
||
|
|
location.reload();
|
||
|
|
};
|
||
|
|
$scope.auth = function (id, token) {
|
||
|
|
User.authenticate(id, token, function (err) {
|
||
|
|
if (!err) {
|
||
|
|
alert('Login successful!');
|
||
|
|
$location.path("/habit");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
]);
|