-
Notifications
You must be signed in to change notification settings - Fork 118
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
Adds Ajax Login Validation #2324
base: 6.dev
Are you sure you want to change the base?
Adds Ajax Login Validation #2324
Conversation
@intoeetive we'll still need to update the Installer to create the |
echo json_encode([ | ||
'result' => ($verify ? 'success' : 'fail'), | ||
'reason' => $reasons, | ||
'username' => ee()->input->get('username'), | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to use ee()->output->send_ajax_response
as it sends the correct header and assures there's no profiler present in AJAX response, if it's enabled
Also not real issue, but result => fail
is not being used in EE, more common are things 'messageType' => 'error',
or 'status' => 'error',
. As well as reason
- could it be error
? Again, this will not create any issues, just trying to keep it more consistent with what we have in other places - let me know if you have specific reason to keep them this way.
I will also make the PR draft until the action record part and the docs are ready
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, no reason whatsoever for it; was just a carry over from previous implementations. What you think of something like this:
ee()->output->send_ajax_response([
'messageType' => ($verify ? 'success' : 'error'),
'errors' => $reasons,
'username' => ee()->input->get('username'),
]);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... maybe messages
in lieu of errors
...
I think I found how to do the updater stuff; shoulda realized it was in the Add-on proper. @intoeetive can you poke at the upd.member change? I think I did it right but confidence isn't as high as I'd like. |
@@ -80,6 +83,11 @@ public function update($current = '') | |||
ee()->db->update('actions', ['method' => 'do_member_search']); | |||
} | |||
|
|||
if (version_compare($current, '6.3.4', '<')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of add-ons updater, $current
represents the add-on version, not EE version. So you would need to update version in addon.setup.php
and use corresponding version in this check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, good to know; updated and pushed anew :)
Overview
Adds an Action to validate a username and password pair, ideally within an Ajax request prior to login form submission.
Resolves #1993.
Nature of This Change
Is this backwards compatible?
Documentation
User Guide Pull Request: https://github.com/ExpressionEngine/ExpressionEngine-User-Guide/pull/NNN