diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 6a248e698a..e7083933a6 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -5,7 +5,7 @@ class UsersController < ApplicationController user = User.where(invitation_token: params[:token]).first if user - user.update(password: params[:password], invitation_token: nil) + user.update(first_name: params[:first_name], last_name: params[:last_name], password: params[:password], invitation_token: nil) user.organization_users.first.update(status: 'active') if params[:new_signup] diff --git a/frontend/src/InvitationPage/InvitationPage.jsx b/frontend/src/InvitationPage/InvitationPage.jsx index dccf6672d8..7139089c67 100644 --- a/frontend/src/InvitationPage/InvitationPage.jsx +++ b/frontend/src/InvitationPage/InvitationPage.jsx @@ -22,12 +22,12 @@ class InvitationPage extends React.Component { e.preventDefault(); const token = this.props.match.params.token; - const { password, organization, newSignup } = this.state; + const { password, organization, newSignup, firstName, lastName } = this.state; this.setState({ isLoading: true }); userService - .setPasswordFromToken({ token, password, organization, newSignup }) + .setPasswordFromToken({ token, password, organization, newSignup, firstName, lastName }) .then(() => { this.setState({ isLoading: false }); toast.success('Password has been set successfully.', { hideProgressBar: true, position: 'top-center' }); @@ -47,27 +47,54 @@ class InvitationPage extends React.Component {
- +

Set up your account

{newSignup === "true" && -
- -
- - + <> +
+ +
+ + +
-
+
+ +
+ + +
+
+
+ +
+ + +
+
+ }
@@ -78,7 +105,6 @@ class InvitationPage extends React.Component { name="password" type="password" className="form-control" - placeholder="Password" autoComplete="off" /> @@ -92,19 +118,21 @@ class InvitationPage extends React.Component { name="password_confirmation" type="password" className="form-control" - placeholder="Password" autoComplete="off" />
+

+ By clicking the button below, you agree to our Terms and Conditions. +

diff --git a/frontend/src/_services/user.service.js b/frontend/src/_services/user.service.js index 647e4ddc79..e8d7a2de87 100644 --- a/frontend/src/_services/user.service.js +++ b/frontend/src/_services/user.service.js @@ -30,12 +30,14 @@ function deleteUser(id) { return fetch(`${config.apiUrl}/users/${id}`, requestOptions).then(handleResponse); } -function setPasswordFromToken({ token, password, organization, newSignup }) { +function setPasswordFromToken({ token, password, organization, newSignup, firstName, lastName }) { const body = { token, password, organization, - new_signup: newSignup + new_signup: newSignup, + first_name: firstName, + last_name: lastName }; const requestOptions = { method: 'POST', headers: authHeader(), body: JSON.stringify(body) };