1

Is it possible to only check the password with ember-simple-auth? I want the user to re-enter their password if they want to delete their account. Can this password check be done without touching the store using ember-simple-auth?

If I use code similar to this:

let loginPromise =
    session.authenticate('authenticator:jwt', { identification, password })
return loginPromise.then(() => true).catch(() => false) // allow/deny to delete the account

then the session is invalidated if the password is wrong, so the user is signed out. I want, however, to only disable the "Delete Account" button if the password is wrong (without any other side effects like signing in).

4
  • Were you able to solve this case? I am stuck with the same issue for confirmation before changing password Commented Jul 1, 2017 at 9:25
  • For now, I am settling for storing the plain text password in session.data.authenticated.password after login and comparing it with this when required. If anyone is having better solutions, please let me know. Commented Jul 1, 2017 at 11:46
  • No, I wasn't able to really solve this problem. I circumvented it by sending the POST request for a login manually with jQuery. Not elegant at all, but it works. Commented Jul 2, 2017 at 10:29
  • For reference (app/services/authenticated-user.js): Ember.Service.extend({ ajax: Ember.inject.service(); validatePassword(username, password) { return this.get('ajax').post(${ENV.host}/users/sign_in, { data: { user: { name: username, password: password } } }) } ... }) Commented Jul 2, 2017 at 10:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.