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

Add a Lock event 'sso login' #1742

Merged
merged 2 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Lock will emit events during its lifecycle.
- `signup submit`: emitted when the user clicks on the submit button of the "Sign up" screen.
- `signup error`: emitted when signup fails. Has the error as an argument.
- `federated login`: emitted when the user clicks on a social connection button. Has the connection name and the strategy as arguments.
- `sso login`: emitted when the user clicks on an enterprise SSO connection button. Has the lock ID, connection object, and field name as arguments.

### show(options)

Expand Down
5 changes: 5 additions & 0 deletions src/connection/enterprise/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ function logInActiveFlow(id) {
function logInSSO(id, connection) {
const m = read(getEntity, 'lock', id);
const field = databaseLogInWithEmail(m) ? 'email' : 'username';
l.emitEvent(m, 'sso login', {
lockID: id,
connection: connection,
field: field
});
coreLogIn(id, [field], {
connection: connection.get('name'),
login_hint: getFieldValue(m, field)
Expand Down