Zujajah chaudhary
Zujajah chaudhary

Reputation: 1

firebase - restrict user from logging in for 14 days

I have an admin panel in my app and I want that if a user has been restricted from the admin panel, he/she must not be able to log into the account for 14 days. I am using firebase with react native

Upvotes: 0

Views: 137

Answers (1)

Ryan
Ryan

Reputation: 1050

You could store the user id in your database (Firestore or Realtime), with a value such as isBlocked along with a date that the block was imposed, dateBlocked.

Then, when you want to block a user, you simply update the database with these values. When a user logs in, query your DB to see if the user isBlocked and that the dateBlocked is less than 14 days ago, and you can then decide what to do with your user.

Upvotes: 2

Related Questions