Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7040911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:58:29+00:00 2026-05-28T01:58:29+00:00

My Devise + Omniauth setup currently uses the following path to log a user

  • 0

My Devise + Omniauth setup currently uses the following path to log a user in using Facebook:

user_omniauth_authorize_path(:facebook)

I have a partial that displays a list of items, each item having a link that:

1) logs the user in with the above path if not logged in

2) links to the item show page if they are logged in

If not logged in, I’d like to modify #1 to redirect the item show page of the particular item that was clicked on after login.

This would require passing the id of the item into the Omniauth controller somehow.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:58:29+00:00Added an answer on May 28, 2026 at 1:58 am

    No, it is done in a simpler way.

    In your item controller set a before_filter

    class ItemController < ApplicationController
      before_filter :authenticate_user!
    end
    

    Then render all your links as links to items, something like this:

    <%= link_to 'item', item_path(@item) %>
    

    In this case, if user is not logged in and tries to view some item, he’s redirected to login page, and after login he’s redirected back to the item he wanted to view.

    This approach also ensures that your items cannot be viewed unless user is logged in (even if he, say, copied a link to item and sent it to a friend, who doesn’t have account on your site).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After following: https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview I can sign up a user via Facebook. But I'm struggling
I have successfully implemented login with Facebook using Devise and OmniAuth (built into Devise).
I have followed the omniauth devise facebook app as explained by Ryan in episode
So, I just got setup using Rails 3, Devise and OmniAuth via https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview .
I am using Devise and omniauth for authentication in my rails app. I have
I'm using OmniAuth + Devise to allow users to register using Facebook/Twitter/Gowalla/etc attached to
I have an app in which I am implementing authentication using devise and omniauth.
I'm using Omniauth with Devise to authenticate users via Facebook for a web app
I need some clarification with Omniauth for facebook and twitter. I m using Devise
I'm using devise/omniauth to do facebook authentication and works great. However, I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.