From e58cdee246d5b5f6c34ebe9b603a4a0ff2327246 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 25 Jun 2020 10:26:59 +0300 Subject: [PATCH] Small typo in register page, submit on enter fixed in auth pages --- .../cc/ui/src/components/pages/LoginPage.js | 13 ++++++------- .../cc/ui/src/components/pages/RegisterPage.js | 11 +++++------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js index 44e9dc595..04e1ab506 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js @@ -4,10 +4,11 @@ import {Button, Col, Container, Form, Row} from 'react-bootstrap'; import AuthService from '../../services/AuthService'; import Particles from "react-particles-js"; import {particleParams} from "../../styles/particle-component/AuthPageParams"; -import monkeyDetective from "../../images/militant-monkey.svg"; +import monkeyGeneral from "../../images/militant-monkey.svg"; class LoginPageComponent extends React.Component { - login = () => { + login = (event) => { + event.preventDefault() this.auth.login(this.username, this.password).then(res => { if (res['result']) { this.redirectToHome(); @@ -66,12 +67,10 @@ class LoginPageComponent extends React.Component {

Login

-
+ this.updateUsername(evt)} type='text' placeholder='Username'/> this.updatePassword(evt)} type='password' placeholder='Password'/> - { @@ -84,7 +83,7 @@ class LoginPageComponent extends React.Component {
- infection monkey + infection monkey diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RegisterPage.js b/monkey/monkey_island/cc/ui/src/components/pages/RegisterPage.js index 4706ff819..62ff0e170 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RegisterPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RegisterPage.js @@ -10,7 +10,8 @@ class RegisterPageComponent extends React.Component { NO_AUTH_API_ENDPOINT = '/api/environment'; - register = () => { + register = (event) => { + event.preventDefault(); this.auth.register(this.username, this.password).then(res => { this.setState({failed: false, error: ''}); if (res['result']) { @@ -89,13 +90,11 @@ class RegisterPageComponent extends React.Component {

First time?

Let's secure your Monkey Island!

- + this.updateUsername(evt)} type='text' placeholder='Username'/> this.updatePassword(evt)} type='password' placeholder='Password'/> -