This commit is contained in:
Brandon Thomas committed 2021-09-01 04:02:47 -04:00
1 parent 5e99de08b3
commit 5eb8e48015
2 files changed
+1 -9

No files matched your search

-5
View File
@@ -1,7 +1,6 @@
import React, { useState } from 'react';
import { SessionWrapper } from '../../../session/SessionWrapper';
import { useHistory } from "react-router-dom";
import { ApiConfig } from '../../../common/ApiConfig';
import { UserIcon } from '../_icons/UserIcon';
import { EnvelopeIcon } from '../_icons/EnvelopeIcon';
import { CreateSession, CreateSessionIsError, CreateSessionIsSuccess } from '../../api/user/CreateSession';
@@ -41,15 +40,11 @@ function LoginFc(props: Props) {
const handleFormSubmit = async (ev: React.FormEvent<HTMLFormElement>) : Promise<boolean> => {
ev.preventDefault();
const api = new ApiConfig();
const endpointUrl = api.login();
const request = {
username_or_email: usernameOrEmail,
password: password,
}
const response = await CreateSession(request);
if (CreateSessionIsError(response)) {
@@ -1,5 +1,4 @@
import React from 'react';
import { ApiConfig } from '../../../common/ApiConfig';
import { AsteriskIcon } from '../_icons/AsteriskIcon';
import { EnvelopeIcon } from '../_icons/EnvelopeIcon';
import { Link } from 'react-router-dom';
@@ -220,9 +219,7 @@ class SignupComponent extends React.Component<Props, State> {
usernameInvalidReason: response.error_fields['username'] || "",
})
}
}
if (CreateAccountIsSuccess(response)) {
} else if (CreateAccountIsSuccess(response)) {
console.log('querying new session');
this.props.querySessionCallback();