Devise and user registration requiring admin approval - ruby-on-rails

I would like to implement the following registration system :
User signs up and is redirected
to a thank you for signing up page
(is NOT sent an email and cannot yet log in)
Admin logs in and sees list of newly registered (but as yet unapproved) users
Admin edits user details and clicks 'Approved' which then sends email with password to new user
How can I do this with Devise?

This is answered in a page on the Devise wiki.

Related

How do I resend invitation to a user using devise invitable?

I have devise invitable gem
Hooked up in my app as well as devise.
Everything working fine. When I create new user, they are saved in database and mailer sends email an email address. User clicks on email, sets password and then is logged in.
But sometimes these users lose their email or rather can’t find it in their email inbox. I’d like to have a resend invite button on the users index page.
When user clicks resend, I want the invites user to get another email sent to them.
Had anyone successfully accomplished this with devise invitable? If so, can you share how?
The gem adds a resend_invitation configuration parameter on your invitable-enabled model. From the docs:
resend_invitation: resend invitation if user with invited status is invited again. Enabled by default.
So, calling .invite! again on a record that's marked as invited will do the trick for you.

How to authenticate the user from the email?

I have a rails application which uses devise for authentication. when the application sends any notification to the user, then in order to see the notification or messages i provide a link to my rails application which redirects to a login page.
how can i avoid this login process, means i don't want the user to be asked to login by entering email and password, instead whenever the user clicks on that link, then the user should automatically login.
Devise provides sign_in controller helper which allows you to pass authentication programmatically.
sign_in(user)

Confirm (as an admin) a User created with Devise

I am using Devise and since my app is in Beta, I want to control which users who have signed up can sign in.
So, even if the confirmation email is sent, how can I make it so that just when an admin has confirmed the account they will be able to sign in? Is there any module in Devise that would let me do so?
All you need to do is add an "approved" attribute to your user table, use admin to change its status and before sign in you can check whether user is approved or not. You can find detailed information here: link

Authenticate account if email exists after facebook auth

Users can register an account on my site via the default authentication method that requires a username, email and password.
To allow users to login via facebook, I am using the facebook gem with Omniauth gem.
Existing guides shows me how to authenticate the users up to the point where they can confirm their details ("is your first and last name correct?") before successfully tying the uid and provider to the user record.
However, it does not check if the email is the same.
Does anyone know how to check if the email is the same and if it is, request the user to provide their password to the account already registered on my site either on the same screen for confirming user details or a new screen with just a password field and a message indicating that he needs to confirm he owns an account on my site with the same email facebook provides.
Should this be done on the model or controller layer? How would you go about doing this?

Devise - Require the user to confirm their email address on change

After a user is registered on a rails 3 + devise app. If the user wants to change their email, how can you only allow the change once their confirm the new email via a validation link?
User Story:
User signs into app (already a user)
User changes their email address
User receives an email at the new address, with a link to click and validate the email
Once the user clicks the link, the new email is saved into the db
Anyone tackel this before? Or is this 100% custom?
Same question here
It's 100% custom, you (and I) have to wait for the Devise team to implement it.

Resources