devise

Omniauth Facebook Manual Rails Routes

流过昼夜 提交于 2020-01-01 07:34:12
问题 I am trying to use Omniauth facebook with two devise models in a Rails 3 app. Currently that's not something that's possible using omniauthable and the devise helpers. A similar question answered how to do this: Omniauth "with" STI and devise "..move your omniauth configuration from devise.rb to omniauth.rb and create your own omniauth routes.' But I am having trouble in defining these routes and helpers, i.e. for facebook I used a devise helper like this: user_omniauth_authorize_path(

Rails Devise thrown 302 error for non confirmed user

不羁岁月 提交于 2020-01-01 06:30:07
问题 I have integrated the devise for coaches login in ROR site. It is working fine but when I tried to login through a user who is not confirmed yet it thrown 302 error. Here are the details of the code I have used: 1) Database Schema: create_table "coaches", :force => true do |t| t.string "first_name", :limit => 20 t.string "last_name", :limit => 20 t.integer "status", :limit => 2, :default => 0 t.datetime "created_at" t.datetime "updated_at" t.string "email", :default => "", :null => false t

Rails Devise User Exists on empty DB

女生的网名这么多〃 提交于 2020-01-01 06:26:27
问题 I am trying to create a User through Devise but am running into issues. home#land def land @resource = User.new @devise_mapping = Devise.mappings[:user] end land.html.haml = form_for @resource, :as => :user, :url => registration_path(:user), :remote => true do = label_tag 'user[email]', raw("<h3>Stay Informed!</h3>") = text_field_tag 'user[email]', nil, {:placeholder => "Your email", :required => true} %input(type="submit" name="commit" value="Add") user.rb class User < ActiveRecord::Base

Rails 4 How Overwrite Devise Respond Path Upon Error

我是研究僧i 提交于 2020-01-01 04:14:06
问题 I've been struggling for a while with this one. I have a Rails4/Devise 3.1 app with two users in the system: Graduates Employers and one devise User who can be either a Graduate or Employer via a polymorphic :profile association. I have Graduates sign up via /graduate/sign_up path and employers via /employer/sign_up path both of which route to the same /views/devise/registrations/new.html.erb view (since their signup form is pretty much the same - email and password). Everything works fine,

RESTful login with devise (Rails 4)

拟墨画扇 提交于 2020-01-01 03:40:06
问题 How do I do RESTful sign-up and sign-in using devise in Ruby on Rails (I am using version 4)? I could not find any documentation with regards to the parameters (e.g. email, password) that I should POST to the server. It seems that RESTful login using JSON data (e.g. via AJAX) is not supported out of the box in the current version of devise - the default behavior is to send back a whole HTML page for any type of request made, instead of a JSON object for handling JSON request specifically.

Problem with Routes using Devise and Omniauth

徘徊边缘 提交于 2020-01-01 03:35:06
问题 I am trying to get OAuth and Devise working together but I get Controller::RoutingError (No route matches "/users/auth/facebook/callback"): when trying to auth via Facebook. Weirdly, the problem doesn't happen with Google Apps. (same callback route). Any ideas? callback_controller: class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def facebook # You need to implement the method below in your model @user = User.find_for_facebook_oauth(env["omniauth.auth"], current

Devise not working well with multiple subdomains on RoR3 application

徘徊边缘 提交于 2020-01-01 02:46:08
问题 I have seen a lot of questions about this topic, but a lot of them have contradictory information, and for some reason it didnt work for me. I have: a top level domain: i.e. lvh.me (development). each user has subdomains: i.e. userdomain.lvh.me The login form is in the top level domain: lvh.me I want: If an user logs in, the session needs to be shared between all the subdomains. I mean, the session needs to be active in lvh.me:3000/something and userdomain.lvh.me:3000 If an user logs out from

omniauth-facebook cannnot get email address

谁说我不能喝 提交于 2020-01-01 02:40:34
问题 I created new Rails App and install Devise and omniauth-facebook gem. And setting my Facebook App, as testing environment. So, I logged in via facebook and signed up my new Rails app, but request.env did not contain email address.info. this is returned request.env['omniauth.auth'] { "provider" => "facebook", "uid" => "xxxxxxxxxxxx", "info" => { "name" => "xxxxxxx", "image" => "http://graph.facebook.com/xxx/picture" }, "credentials" => { "token" => "tokenstring", "expires_at" => xxxxxxxxx,

Create another model upon user new registration in devise

时间秒杀一切 提交于 2019-12-31 10:54:57
问题 I'm using devise to do the new user registration. Right after a new user is created, I would also like to create a profile for that user. My create method in the registrations_controller.rb is as follows: class RegistrationsController < Devise::RegistrationsController def create super session[:omniauth] = nil unless @user.new_record? # Every new user creates a default Profile automatically @profile = Profile.create @user.default_card = @profile.id @user.save end But, it is not creating a new

Token authentication with Rails and Devise

北慕城南 提交于 2019-12-31 10:36:11
问题 I'm following this excellent article to setup the authentification part of my rails (3.2) API: http://blog.joshsoftware.com/2011/12/23/designing-rails-api-using-rabl-and-devise/ I have done the following step: -Added devise to Gemfile -Enabled devise for the user model and ran the migrations required -My user model is class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable devise :token_authenticatable attr