-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session#login could return a Promise resolving to redirectUrl (or an object containing it) #2066
Comments
The reason why the This design will need to evolve when we add support for popup-based redirect, and then |
Actually, currently, we only use this client in node. Looking at the description, the behavior in the browser doesn't seem clear. First, it says if provided, the browser will not auto-redirect just to later state ignored in the browser. To keep the interface consistent across platforms, the following approach might work:
|
Oh I see, I didn't realize this was about the Node behaviour. I'll see what can be done, but consider the following:
The However, what you're pointing out about the |
I'm only talking about step 1, and the |
Ok I see what you mean now. We are considering making a split between a low-level and a high-level library, the low-level one giving a finer control to application developers with specific auth requirements. Returning the redirect IRI, and leaving it up to the developer to handle the redirection, could be a feature of such an API. It is unlikely that we add this to the higher-level one though, which we want to keep as simple as possible, which sometimes means limiting the number of options. To make sure I'm approaching this at the right angle: this isn't blocking you, right? It would be a nice optimization, but it isn't preventing you from implementing your use case, does it? |
Yes, it's mostly about the ergonomy of the interface, as well as a slightly more convenient way to mock it in tests. |
Search terms you've used
login
Impacted environment
In which environment would the proposed feature apply ?
Feature suggestion
Session#login
could return a Promise resolving to theredirectUrl
(or an object containing it), which gets passed tohandleRedirect
callback.Actual functionality/enhancement
Currently
Session#login
returnsPromise<void>
which is not very useful.Having the
redirectUrl
available once Promise resolves would make some of our code a little simpler. It would also simplify mocking thelogin
in tests.The text was updated successfully, but these errors were encountered: