Last active
August 29, 2015 14:01
-
-
Save mikeadeleke/ce98fe803a507bb1ae0d to your computer and use it in GitHub Desktop.
Devise Confirmable with Omniaauth
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The players are Devise, Devise Confirmable, and Omniauth Facebook. The issues is hand is that either when I sign up with email or Facebook, the user is not being confirmed in the database and is essentially locked out of the application. | |
I have provided a series or screenshots to show the issues and will also show the code. | |
Home page | |
https://www.dropbox.com/s/u93zkqdq7l8q5a1/Screenshot%202014-05-16%2015.24.57.png | |
Signing up with Facebook | |
https://www.dropbox.com/s/yb7yf1cuzhcnfld/Screenshot%202014-05-16%2015.27.07.png | |
Comes back to verify their college email and phone number | |
https://www.dropbox.com/s/ckdczmxo7z4u8ns/Screenshot%202014-05-16%2015.27.39.png | |
Get their confirmation email | |
https://www.dropbox.com/s/zjbfyoe6to24ti2/Screenshot%202014-05-16%2015.28.48.png | |
They click the link and this is where they go (nowhere really) | |
https://www.dropbox.com/s/sapaaucxybolo08/Screenshot%202014-05-16%2015.29.23.png | |
When they try to login | |
https://www.dropbox.com/s/beb03n795c5hesp/Screenshot%202014-05-16%2015.29.58.png | |
In the console, the user has failed to be confirmed yet which may be the issue | |
https://www.dropbox.com/s/4amnbab0q23p1fh/Screenshot%202014-05-16%2015.31.43.png | |
omniauth_callbacks_controller.rb (users) | |
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | |
def facebook | |
@user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) | |
if @user.persisted? | |
sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated | |
set_flash_message(:notice, :success, :kind => "Facebook") if is_navigational_format? | |
else | |
session["devise.facebook_data"] = request.env["omniauth.auth"] | |
redirect_to new_user_registration_url | |
end | |
end | |
end | |
I tried something where I deleted the users/show.html.erb and this is what I found | |
https://www.dropbox.com/s/0ogajhcb40cv35w/Screenshot%202014-05-16%2015.42.26.png | |
TL;DR | |
1) My used upon clicking my confirmation link is not confirmed | |
2) I don't know where they redirect is coming from since I do not have a confirmations model or controller | |
3) The user is locked out of the app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment