Skip to content
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

[feature-request] Provide arguments to onLogin / onLoginFailure on client #7385

Closed
mjmasn opened this issue Jul 11, 2016 · 2 comments
Closed

Comments

@mjmasn
Copy link
Contributor

mjmasn commented Jul 11, 2016

There's some discussion of this at #3572 but that issue is closed and not specific to this issue.

It would be good to have at least the type and error passed to onLogin/onLoginFailure callbacks on the client. I can sort of understand the argument for not providing the method arguments e.g. email/username & password (although the point is moot, you either trust the client side code you're bundling or it shouldn't be in there) but the other non-sensitive-information arguments that are available on the server should be supplied. These are type, allowed, error, user, connection, and methodName [but not methodArguments].

The use case is checking for a specific error on login, which is fine if using a login form that calls Meteor.loginWithPassword with a callback but not fine on a session resume / page refresh etc. If a specific error appears I need to redirect the user to a different website along with a login token for that website. I want to provide these details in the error object from the server because I don't see another way of returning anything from a login attempt to the user.

@mjmasn
Copy link
Contributor Author

mjmasn commented Jul 11, 2016

About to go on holiday so not going to do a full PR but minimal fix to get the error in the callback is a 1 line change. See devel...mjmasn:7385-provide-error-to-onloginfailure-callback

Not sure about providing the other arguments, that may be more involved.

@s-ol
Copy link

s-ol commented Jul 22, 2016

+1, currently it seems to be impossible to obtain ANY error information from implicit login attempts using a cached session token (when re-opening a page).
It is also impossible to differentiate between such implicit login attempts and user-initiated login attempts / explicit method calls, I basically have the same use case. I think the error object would be sufficient for nearly all use cases and definetely safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants