add registration and session logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { testConnect } from '@/app/api/action';
|
||||
import { testConnect } from '@/app/lib/action';
|
||||
|
||||
async function clickHandler() {
|
||||
testConnect();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState, useRef } from 'react';
|
||||
import { fetchFruits } from '@/app/api/action';
|
||||
import { fetchFruits } from '@/app/lib/action';
|
||||
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
||||
import Link from 'next/link';
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
import styles from '@/app/styles/login.module.scss'
|
||||
import { useActionState } from 'react';
|
||||
import { authenticate } from '@/app/api/action';
|
||||
import { authorization } from '@/app/actions/auth';
|
||||
|
||||
export default function LoginForm() {
|
||||
const [errorMessage, formAction, isPending] = useActionState(
|
||||
authenticate,
|
||||
authorization,
|
||||
undefined,
|
||||
);
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import styles from '@/app/styles/login.module.scss';
|
||||
import { useActionState } from 'react';
|
||||
import { registration } from '@/app/api/action';
|
||||
import { registration } from '@/app/actions/auth';
|
||||
|
||||
export default function RegisterForm() {
|
||||
const [errorMessage, formAction, isPending] = useActionState(
|
||||
@@ -23,7 +23,7 @@ export default function RegisterForm() {
|
||||
<div className={`${styles['form-row']}`}>
|
||||
<div className={`${styles['form-group']}`}>
|
||||
<label className={`${styles['form-label']} ${styles['required']}`}>Email адрес</label>
|
||||
<input type="password" id="email" name="email" className={`${styles['form-input']}`} placeholder="ivan@example.com" />
|
||||
<input type="text" id="email" name="email" className={`${styles['form-input']}`} placeholder="ivan@example.com" />
|
||||
</div>
|
||||
<div className={`${styles['form-group']}`}>
|
||||
<label className={`${styles['form-label']}`}>Телефон</label>
|
||||
|
||||
Reference in New Issue
Block a user