Hi:
I am trying to figure out how to redirect a user to the page they logged in from (or failed to login) using Warden/Devise. I figure there is a session variable somewhere that is either available or could be made available.
E.g.
Scenario 1:
Non-authorized user goes to protected page X;
Redirected to login page;
User logs in;
User re...
I am now currently changed to use the Gem Devise for user authentication. But I don't know how to match the encryption!
I knew that we could write a new encryptor and assign it in initializers, but the point is the encryptor accepts 4 arguments only (password, stretches, salt, pepper). But in my case, I do included the user's email and ...
I'm using Devise as authenticating solution in Rails and I have a cached fragment :recent_users.
I want this fragment to expire when a new user is registered, changed or removed, so I put in my(manually created) users_controller.rb
class UsersController < ApplicationController
cache_sweeper :user_sweeper, :only => [:create, :updat...
This is just plain weird.
I've got Rails 3 RC running with Devise installed. I've defined a custom strategy to try and use Kerberos for authentication.
module Devise
module Strategies
class Kerb < Devise::Strategies::Base
def valid?
params[:username] || params[:password]
end
def authenticate!
...
I'm new to rails, and even more new to devise.
I have set up a user controller and I've managed to create a view showing the e-mail address of the current user. Now I want a user profile page, where the user can add personal information etc, and keep track of published posts etc. Basic community functions.
How should I design this? Sho...
I have the same issue as http://stackoverflow.com/questions/3027555/creating-an-additional-related-model-with-devise (which has no answer).
I have overridden the devise view for creating a new user and added a company name, I have changed the model to use accepts_nested_attributes_for
There are no errors, but it is not adding the neste...
I am doing this in config/initializer/devise.rb using rails3 rc and ruby 1.9.2rc
config.warden do |manager|
manager.oauth(:twitter) do |twitter|
twitter.consumer_secret = "...key....."
twitter.consumer_key = ".....app_key......"
twitter.options :site => 'http://twitter.com'
end
# manager.default_strategies(:scope =>...
I have added a field to the sign-up form that is based on a different model, see http://stackoverflow.com/questions/3544265/how-do-i-use-nested-attributes-with-the-devise-model for the gory details. This part is working fine.
The problem now is when I save, it is failing in the create action of the registrations controller that is suppl...
I'm running into some issues when trying to add Devise to my Rails 3 app. I started by creating a new Rails 3 (rc2) app with a "Home" controller and "index" action and verified that "/" would render "#home/index". Next I set devise 1.1.1 in my Gemfile, installed Devise, created a User model, and migrated the database. Now "/" returns No ...
Hello,
I am developing a Rails3 application and Devise for authentication. In the course of the workflow, I am storing information in the session, like patient_id. But, when the user log's out, I need to clear the session. I could've done it if I has control of user login and logout. But, now devise handles it.
How could I do it?
...
Hi,
I am used to generating my rspec controllers & models using rspec_X syntax, e.g.
script/generate rspec_model Person
script/generate rspec_controller Person
However if I want to use devise to create a Person model the syntax is:
script/generate devise Person
which works OK, but does not create any of the rspec test files / dirs...
Hello, I have an app that uses Devise and CanCan.
in the config>initializers>Abiliity.rb
class Ability
include CanCan::Ability
def initialize(user)
if user.is? :superadmin
can :manage, :all
elsif user.is? :user
can :read, Project do |project|
project && project.users.include?(user)
end
...
I have a Rails 3 application using Devise for authentication. Now I need to allow someone to log in using their Facebook account. I think this is called Facebook Connect, but I've also heard the term Facebook Graph API, so I'm not sure which one I'm asking for.
What do I need to do in order to integrate Facebook Connect with Devise?
...
I'm trying to add a really simple strategy to devise, and it doesn't seem to be working. Here is the code that I am trying to use
#config/initializers/devise.rb
Devise.setup do |config|
config.orm = :mongo_mapper
config.warden do |manager|
manager.strategies.add(:auto_login_strategy) do
def valid?
params[:auto_l...
I am new to ruby on rails. I am originally a PHP/mysql programmer. I can not seem to understand how you connect any posts to the user and display them (e.g. a post is successfully created with the user ID and then the users ID is queried to get his or her name.)
I am using devise for authentication.
def create
poll = current_user.p...
Hi,
I am using Rails 2.3 and Devise to handle user registration / authentication.
I need to redirect a user to an external 3rd party website immediately after a user signs up for an account. Been looking in the code & online but cannot see how to do this.
How can I alter the devise flow to redirect the user?
Thanks!
...
I use the Devise gem with Rails and would like to alter the action that occurs during user registration. My faulty customization looks like this:
devise_for :users, :controllers => { :registrations => "users/registrations" } do
post "/", :to => "users/registrations#create_from_admin"
end
Resulting in this:
[bbrasky@admins-Mac...
Is there a way in Devise 1.0, the library for Rails 2.3, to redirect to a specific URL and not root_url after logging in?
EDIT: forgot to mention it's Devise 1.0
...
Hello, Rails 3 newbie here... I'm working to create a devise auth system that like (yammer) has instances where users belong. I have two tables
Users (email, password...)
belongs_to :instance
Instance (domain name, active....)
has_many :users
I added the belongs_to and has_many to the models but the schema hasn't been updated to a...
Hello,
I have two tables
Users (name, email, password, instance_id, etc...)
example: james bond, [email protected], 1
Instance (id, domain)
example: 1, abc.com
Through out the application I want to make sure James Bond only sees data that is assigned to his instance = 1
So if I have a books table with (name, desc, instance_id), he only ...