diff --git a/src/pages/Login.js b/src/pages/Login.js index cb839ff..2d246f6 100644 --- a/src/pages/Login.js +++ b/src/pages/Login.js @@ -79,7 +79,6 @@ const TwoFactor = () => { if (!code) return; const result = await post('/api/login/verify', { code }); - console.log(result); if (result.status === 200) { setUser(await fetchUser()); return navigate('/home', { replace: true }); diff --git a/src/pages/Users.js b/src/pages/Users.js index f0dfe93..308bec0 100644 --- a/src/pages/Users.js +++ b/src/pages/Users.js @@ -164,14 +164,30 @@ const CreateUserField = () => { const [link, setLink] = useState(null); const getSignupCode = async () => { - const response = await get('/api/signup/code'); - if(response.status === 200) setLink(response.data); + const response = await get('/api/register/code'); + if (response.status === 200) { + const link = `${window.location.origin}/register?code=${response.data.code}`; + setLink(link); + } + }; + + const copyToClipboard = (event) => { + const text = event.target.innerText; + navigator.clipboard.writeText(text); }; return