Request customer password before accessing certain pages

timd_mackey
Shopify Partner
47 1 17

I'd like to require a logged in customer to enter their password again before accessing certain pages. The reason for this: The store I am working on is set up for children to do their own shopping, using a shared account that the parent sets up. I have a rudimentary multi-"user" system set up using a cart attribute to keep track of the current user. I want only the parent to be able to access the account settings page, which means requiring a password when they switch to the parent "user". I'd prefer not having to create a secondary password to do this, it would be better if I can just request their login info again.

0 Likes
timd_mackey
Shopify Partner
47 1 17

Right now I'm toying with an idea—when the user is filling out the registration form, I could use javascript to create a salted hash of the password, and then store that as a customer metafield. Then, I can lock certain pages by having a password form and requiring that the hash of whatever password they enter matches the hash that is stored in the metafield.

EDIT: This might not very secure, currently investigating.

EDIT 2: Yeah, this is probably not a good idea. Any suggestions on the original question of asking for the password again?

0 Likes