mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-03 08:21:07 +00:00
18 lines
498 B
JavaScript
18 lines
498 B
JavaScript
|
|
'use strict';
|
||
|
|
// Make user and settings available for everyone through root scope.
|
||
|
|
habitrpg.controller('SettingsCtrl', 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 succesfull!');
|
||
|
|
$location.path("/habit");
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|