fix login
This commit is contained in:
parent
b33f955a0f
commit
21efb909fb
@ -1,11 +1,10 @@
|
||||
// eslint-disable-next-line
|
||||
const preact = require('preact');
|
||||
const { useState } = require('preact/hooks');
|
||||
|
||||
function renderLogin({ submitLogin, submitRegister }) {
|
||||
const details = {
|
||||
name: '',
|
||||
password: '',
|
||||
};
|
||||
const [name, setName] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
|
||||
return (
|
||||
<div className="login">
|
||||
@ -13,22 +12,22 @@ function renderLogin({ submitLogin, submitRegister }) {
|
||||
className="login-input"
|
||||
type="email"
|
||||
placeholder="username"
|
||||
onInput={e => details.name = e.target.value}
|
||||
onInput={e => setName(e.target.value)}
|
||||
/>
|
||||
<input
|
||||
className="login-input"
|
||||
type="password"
|
||||
placeholder="password"
|
||||
onInput={e => details.password = e.target.value}
|
||||
onInput={e => setPassword(e.target.value)}
|
||||
/>
|
||||
<button
|
||||
className="login-btn"
|
||||
onClick={() => submitLogin(details.name, details.password)}>
|
||||
onClick={() => submitLogin(name, password)}>
|
||||
Login
|
||||
</button>
|
||||
<button
|
||||
className="login-btn"
|
||||
onClick={() => submitRegister(details.name, details.password)}>
|
||||
onClick={() => submitRegister(name, password)}>
|
||||
Register
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -8,7 +8,7 @@ map $http_upgrade $connection_upgrade {
|
||||
}
|
||||
|
||||
server {
|
||||
root /home/git/cryps/client/dist/;
|
||||
root /home/git/mnml/client/dist/;
|
||||
index index.html;
|
||||
|
||||
server_name mnml.gg; # managed by Certbot
|
||||
@ -17,6 +17,10 @@ server {
|
||||
return 301 https://mnml.gg$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
if ($host = cryps.gg) {
|
||||
return 301 https://mnml.gg$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user