fix signup url
All checks were successful
Build and Push Docker Image / Build image (push) Successful in 1m31s

This commit is contained in:
ACoolName 2025-04-09 03:49:17 +03:00
parent e81b7abd1a
commit f8647c50ae

View File

@ -7,7 +7,7 @@ import { fetchToken } from "./login";
const signUp = async (username: string, password: string, token: string) => { const signUp = async (username: string, password: string, token: string) => {
try { try {
const response = await api.post(`/signup?token=${token}`, { const response = await api.post(`/auth/signup?token=${token}`, {
username: username, username: username,
password: password, password: password,
}, { }, {
@ -23,7 +23,7 @@ export function SignupPage(props: {}) {
const [apiAuthenticated, setApiAuthenticated] = useContext(apiAuthenticatedContext) const [apiAuthenticated, setApiAuthenticated] = useContext(apiAuthenticatedContext)
const [searchParam, setSearchParam] = useSearchParams(); const [searchParam, setSearchParam] = useSearchParams();
const token = searchParam.get('token'); const token = searchParam.get('token');
if (token === null){ if (token === null) {
return <Navigate to='/' /> return <Navigate to='/' />
} }
@ -36,7 +36,7 @@ export function SignupPage(props: {}) {
const data = new FormData(event.currentTarget); const data = new FormData(event.currentTarget);
const usernameFormData: FormDataEntryValue | null = data.get('username'); const usernameFormData: FormDataEntryValue | null = data.get('username');
const passwordFormData: FormDataEntryValue | null = data.get('password'); const passwordFormData: FormDataEntryValue | null = data.get('password');
if (usernameFormData === null || passwordFormData === null){ if (usernameFormData === null || passwordFormData === null) {
return return
} }
const username: string = usernameFormData.toString(); const username: string = usernameFormData.toString();