mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: init login & register from frontend
This commit is contained in:
parent
67ce2e7371
commit
8cc727e309
8 changed files with 90 additions and 14 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import React from "react";
|
||||
import Layout from "../components/ui/layout";
|
||||
import { Title } from "../components/ui/styles/title";
|
||||
import { loginAndGetToken } from "../services/auth";
|
||||
|
||||
const Login = () => {
|
||||
const [email, setEmail] = React.useState("");
|
||||
|
|
@ -10,6 +11,7 @@ const Login = () => {
|
|||
e.preventDefault();
|
||||
console.log({ email, password });
|
||||
alert(JSON.stringify({ email, password }));
|
||||
loginAndGetToken(email, password);
|
||||
};
|
||||
|
||||
const handleEmailChange = (e: any) => {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import React from "react";
|
||||
import Layout from "../components/ui/layout";
|
||||
import { Title } from "../components/ui/styles/title";
|
||||
import { signup } from "../services/auth";
|
||||
|
||||
const SignUp = () => {
|
||||
const [email, setEmail] = React.useState("");
|
||||
|
|
@ -11,6 +12,7 @@ const SignUp = () => {
|
|||
e.preventDefault();
|
||||
console.log({ email, password, username });
|
||||
alert(JSON.stringify({ email, password, username }));
|
||||
signup({ email, password, username });
|
||||
};
|
||||
|
||||
const handleEmailChange = (e: any) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue