DigitMagazine

Logging user in

Mar 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. let email = $('#reg_email').val();
  2. let password = $('#reg_password').val();
  3. let name = $('#reg_firstName').val() + ' ' + $('#reg_lastName').val();
  4. $.post(server_addr + '/register', {
  5. name: name,
  6. email: email,
  7. password: password
  8. }, function (data) {
  9. sendDesktopNotification(data.message, 'You Will Be Logged In Automatically');
  10. logIn(email, password);
  11. }).fail(function (error) {
  12. let msg = JSON.parse(error.responseText)['message'];
  13. dialog.showErrorBox('Registration Failed!', msg);
  14. })
Add Comment
Please, Sign In to add comment