Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.execSignup = function () {
- var fullName = $scope.signupForm.FullName,
- username = $scope.signupForm.Username,
- password = $scope.signupForm.Password;
- dsanon.on('error', function (err) {
- console.log("Anonymous Deepstream connection error: ", err);
- });
- var newUserRecord = dsanon.record.getRecord("user/"+username)
- newUserRecord.whenReady(_ => {
- newUserRecord.set({
- fullName: fullName,
- username: username,
- password: password, // This is a PoC, there are a LOT of other security concerns as well - needs more architecting overall
- friends: []
- });
- newUserRecord.discard();
- var newCoordsRecord = dsanon.record.getRecord("coords/"+username);
- newCoordsRecord.whenReady(_ => {
- newCoordsRecord.set({
- latitude: null,
- longitude: null
- });
- newCoordsRecord.discard();
- $ionicPopup.alert({
- "template": "Registration completed! Please login now."
- }).then(function () {
- $scope.registerModal.hide();
- $scope.loginModal.show();
- });
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement