fleet/frontend/components/forms/ConfirmSSOInviteForm/helpers.js
John Murphy 12d2df1f9a Add SSO support to new user activation (#1504)
Closes #1502. This PR adds support for SSO to the new user creation process. An admin now has the option to select SSO when creating a new user.  When the confirmation form is submitted, the user is automatically authenticated with the IDP, and if successful, is redirected to the Kolide home page. Password authentication, password change and password reset are not allowed for an SSO user.
2017-05-10 11:26:05 -05:00

23 lines
371 B
JavaScript

import { size } from 'lodash';
const validate = (formData) => {
const errors = {};
const {
name,
username,
} = formData;
if (!name) {
errors.name = 'Full name must be present';
}
if (!username) {
errors.username = 'Username must be present';
}
const valid = !size(errors);
return { valid, errors };
};
export default { validate };