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

  • Home
  • SEARCH
  • 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 3302604
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:52:10+00:00 2026-05-17T20:52:10+00:00

This seems to keep coming up for me on various projects and I’m wondering

  • 0

This seems to keep coming up for me on various projects and I’m wondering if anyone out there has a great solution:

We have a Rails app with Authlogic authentication. Initially, there’s a nice, clean, RESTful ListingsController that requires a user to be logged in before they can post/create:

before_filter :require_user, :only => [ :new, :create]

However, after seeing this in action we decide we need to try out a different flow where unregistered users can fill out the form for the Listing first and then be prompted to register/login. If they abandon registration, we don’t need to create the Listing. If they authenticate, we want to wire up the Listing with the current_user as we would normally.

A couple possible snags:

  1. The new Listing form allows users to upload files that we store with Paperclip.
  2. Authentication may happen through a series of redirects for facebook or twitter.

I feel like this authenticate post-creation scenario is a common enough that there would be some resources on standard methods for attacking it, but I haven’t really found much. Anyone have a good solution or resource for this?

Thanks!

  • 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-17T20:52:10+00:00Added an answer on May 17, 2026 at 8:52 pm

    One solution is to generate a unique token and store it in your model (say Listing.pending_id), then write the same token to a cookie. Later, when the client is first authenticated, you check for a ‘pending_id’ cookie and link it to the relevant listing if found.

    You’d have to schedule a task to remove any unfinished listings older than (x), and make sure that any pending Listings were excluded from normal operations (searching, listing, etc). Depending on your application you might be better off creating a separate PendingListing model and database table.

    One downside with this approach is that the listing would not be recovered if added on one computer/browser, but authenticated on another.

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

Sidebar

Related Questions

This seems like a pretty softball question, but I always have a hard time
This seems to be a common problem but I cannot find a solution. I
I'm wondering if anybody has run across something similar to this before. Some quick
I keep running across this loading image http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif which seems to have entered into
I keep getting this NPE in my application and I can't seem to get
This seems to be an overlooked area that could really use some insight. What
This seems very noisy to me. Five lines of overhead is just too much.
This seems trivial, but I've never had to worry about it before and my
This seems like a simple question, but I can't find it with the Stack
This seems like a very simple and a very common problem. The simplest example

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.