omniauth-facebook

Omniauth Facebook redirects to registration screen instead of creating user

我是研究僧i 提交于 2019-12-20 02:01:14
问题 Following the gem's tutorial exactly I still seem to be running into some issues. I first click the link to sign up via Facebook and get redirected to Facebook. I click okay and get brought back to my registration page. No new user is created. If I try to click the register link again it just refreshes the page with this in the address bar http://localhost:3000/register#_=_ . What am I doing wrong? User Model devise :database_authenticatable, :registerable, :recoverable, :rememberable,

Devise + Omniauth Facebook redirecting to signup

让人想犯罪 __ 提交于 2019-12-13 15:59:24
问题 I have followed this guide spot on https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview First round it authenticated me, signed me in, and saved me to db. I cleared browser history and tested a different user. It takes new user to facebook page to sign in, and after sign in automatically redirects them to http://localhost:3000/users/sign_up#_=_ and does not sign them in or save to DB. Any Ideas? Routes get "static/home" devise_for :users, :controllers => { :omniauth_callbacks =>

Omniauth Facebook not returning email and gender rails 4

安稳与你 提交于 2019-12-13 14:24:53
问题 I need to fetch name, email, image and gender from facebook. I am getting name and image, but email and gender is not fetched from facebook. I am struggling for past 2 days, can anyone help me out here. User model: def self.from_omniauth(auth) where(provider: auth.provider, uid: auth.uid).first_or_initialize.tap do |user| user.provider = auth.provider user.uid = auth.uid user.name = auth.info.name user.email = auth.info.email user.gender = auth.extra.raw_info.gender #if user.gender.blank?

How to save the request.referrer for facebook omniauth in Rails 4

一笑奈何 提交于 2019-12-13 12:51:19
问题 I have two facebook buttons in my application. One on users/sign_up and other on /visitors/owner-faq . I want to save the request.referrer in order to know from which page the user has signed up. I had implemented the same for external signup(which uses a form) and it worked. Now I'm unable to implement the same for facebook omniauth . Code: #user.rb def self.from_omniauth(auth) email = auth.info.email user = User.find_by_email(email) # first tries to find an existing user who signed up

get first_name and last_name fields from facebook omniauth

与世无争的帅哥 提交于 2019-12-13 11:46:45
问题 I am now implementing omniauth feature into my app. Everything works fine except that i cant get the first and last name from the facebook. Here is my model code. def self.from_omniauth(auth) user = User.where(email: auth.info.email).first if user return user else where(provider: auth.provider, uid: auth.uid).first_or_create do |user| user.provider = auth.provider user.uid = auth.uid user.first_name = auth.info.first_name user.last_name = auth.info.last_name user.email = auth.info.email user

How can I convert float number to timezone?

人盡茶涼 提交于 2019-12-13 05:31:51
问题 How can I convert float number to timezone? Facebook breaks the timezone down using float. timezone float (min: -24) (max: 24) The person's current timezone offset from UTC user.timezone = auth.extra.raw_info.timezone captures a user's timezone location upon signing up via Facebook, for example timezone: -5.0 . I want to convert this though to timezone: "Eastern Time (US & Canada)" . A user could then adjust his timezone via <%= f.time_zone_select :timezone, ActiveSupport::TimeZone.us_zones %

Could not find devise mapping for path “/users/”. How come?

久未见 提交于 2019-12-12 09:55:42
问题 I am working with devise/omniauth right now. After signing up through facebook/twitter, I want to redirect to a page called "verify-email" where they can verify that their email address is correct. I am just trying to get the localhost:3000/users/verify-email page to work right now. I go to that url and I get this error message: Could not find devise mapping for path "/users/update_email". This may happen for two reasons: 1) You forgot to wrap your route inside the scope block. For example:

Authentication failure: omniauth

﹥>﹥吖頭↗ 提交于 2019-12-12 01:42:58
问题 I am following the below tutorial of omniauth-facebook for configuring the authentication method from facebook in my rails application: http://railscasts.com/episodes/360-facebook-authentication Everything is running fine but after callback I'm getting the following error: undefined method `from_omniauth' for #<Class:0x007ff05a58de30> and the code snippet: class SessionsController < ApplicationController def create user = User.from_omniauth(env["omniauth.auth"]) #Highligted line as red

How to authenticate two types of user with same authentication callback in rails?

痴心易碎 提交于 2019-12-11 17:24:32
问题 I want to create a webpage using rails 6.0.0, which has two types of users(model) Admin User/viewer But the problems is that I want to authenticate (sign up /sign in) for both users with facebook or google_oauth2 with same callbacks address: /auth/:provider/callback On internet, github and youtube I have found articles and videos only for authenticate single model. But I want to authenticate (sign up /sign in) for two models. Can anyone help? Please give an idea to authenticate both model

NoMethodError in Devise::RegistrationsController#create /undefined method `encrypted_password=' for #<User:0x459b2b0>

依然范特西╮ 提交于 2019-12-11 10:09:33
问题 I am using omniauth and devise for login/sessions/signup facebook login... I get the error anytime I try to sign up, login, or etc. I guess some other things don t work in my sessions and callbacks. I tried adding encrypted_password in the migrations but still not working. Here is the migration: class AddColumnsToUsers < ActiveRecord::Migration def change add_column :users, :provider, :string add_column :users, :uid, :string add_column :users, :encrypted_password, :string end end Here is my