Giter Site home page Giter Site logo

Comments (6)

dotdotdotpaul avatar dotdotdotpaul commented on April 27, 2024

I was trying to figure this out as a way to handle redirecting the user when they come back from the auth -- I figured I could pass the referer [sic] as an option to the callback URL and then when they come back, after success, I could send them back "where they came from".

It seems like this use case (redirect to where the login originated) would be a pretty frequently desired result -- am I missing something in the current implementation that already does this?

from ueberauth.

terencechow avatar terencechow commented on April 27, 2024

@radzserg @dotdotdotpaul

How are you guys handling this currently? I believe I have a similar use case. I have users which have subscriptions and each subscription can have many authorizations. On an auth callback, I have no idea which subscription has made the the authorization and cannot add the association to my db.

Passing a query param to the request url would solve this. Either that or making the request_path understand params such as subscriptions/:subscription_id/auth/facebook

**Edit: ** Decided to go the query_param route and add a plug that puts my query into a session and removes that immediately after the callback. Doesn't feel right but it works...

from ueberauth.

dotdotdotpaul avatar dotdotdotpaul commented on April 27, 2024

My current hack is that my login URL is now auth/login/:provider, and that shoves the referer into the session, then redirects to auth/:provider to let Ueberauth work as usual. Then I added to the callback function code that checks the session for the referer, removes it from the session and then redirects (defaulting to "home" if not found). Works fine, if your user is using cookies -- but I figure if someone isn't using cookies, the login isn't going to work particularly well anyway.

from ueberauth.

doomspork avatar doomspork commented on April 27, 2024

@radzserg I haven't personally had a need for this functionality but there is quite a bit of interest, would you be interested in submitting a pull request for review?

from ueberauth.

radzserg avatar radzserg commented on April 27, 2024

@doomspork I will. Give me 2 weeks. Completely busy this week.

from ueberauth.

radzserg avatar radzserg commented on April 27, 2024

I prepared pull request
#45

from ueberauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.