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