Comments (6)
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.
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.
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.
@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.
@doomspork I will. Give me 2 weeks. Completely busy this week.
from ueberauth.
I prepared pull request
#45
from ueberauth.
Related Issues (20)
- OAuth2 needs new maintainers HOT 4
- State nonce cookie should properly be signed HOT 2
- How can run Ueberauth plug directly? HOT 3
- Custom `callback_port` and `callback_scheme` not used HOT 1
- Callback URL not mounted right when router has nested paths
- Can't set strategy options at runtime HOT 2
- Line Login v2.1 update request which I've done HOT 4
- Gracefully handle unknown providers HOT 10
- callback_port config compiled into plug at compile time HOT 10
- App.Auth.AuthController.request/2 is undefined or private HOT 1
- minor: mix package versions are out of date
- New hex.pm release? HOT 1
- Incorrect callback_url when using Bandit.PhoenixAdapter
- put_session successful, but get_session failed HOT 1
- function MyAppWeb.OAuthController.request/2 is undefined or private HOT 1
- Support for nonces HOT 1
- FR: Support multiple usages of the same strategy in config HOT 13
- Incomplete docs to configure pipeline and check that user is authenticated HOT 3
- Latest release breaks existing paths HOT 6
- Latest version is retired HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ueberauth.