This commit is contained in:
Erik 2022-11-10 20:47:08 +02:00
parent 79ee04478a
commit 5b95593d9c
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
3 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@
<h2>Log in</h2> <h2>Log in</h2>
<form action="/api/login" method="post"> <form action="/api/login" method="post">
<label for="username">Username: </label> <label for="username">Username: </label>
<input id="username" name="username" type="text" required><br/> <input id="username" name="username" type="text" autocomplete="off" required><br />
<label for="password">Password: </label> <label for="password">Password: </label>
<input id="password" name="password" type="password" required><br /> <input id="password" name="password" type="password" required><br />
<input type="submit" value="Log in"> <input type="submit" value="Log in">
@ -26,7 +26,7 @@
<h2>Register</h2> <h2>Register</h2>
<form action="/api/register" method="post"> <form action="/api/register" method="post">
<label for="username">Username: </label> <label for="username">Username: </label>
<input id="username" name="username" type="text" required><br /> <input id="username" name="username" type="text" autocomplete="off" required><br />
<label for="password">Password: </label> <label for="password">Password: </label>
<input id="password" name="password" type="password" required><br /> <input id="password" name="password" type="password" required><br />
<input type="submit" value="Register"> <input type="submit" value="Register">

View File

@ -167,7 +167,7 @@ class Server extends EventEmitter {
this.logger.info(`${profile.username} (${profile.id}) is logging in.`); this.logger.info(`${profile.username} (${profile.id}) is logging in.`);
const user = await this.userDatabase.userFromDiscord(profile); const user = await this.userDatabase.userFromDiscord(profile);
callback(null, user); callback(null, user);
}), { successRedirect: '/api/login/discord/finalise' }); }), { successRedirect: '/home' });
this.authenticator.addStrategy('local', new LocalStrategy(async (username, password, callback) => { this.authenticator.addStrategy('local', new LocalStrategy(async (username, password, callback) => {
const user = await this.userDatabase.findUser(username); const user = await this.userDatabase.findUser(username);

View File

@ -30,6 +30,8 @@ class User {
/** @private */ /** @private */
this._passwordHash = data.password || null; this._passwordHash = data.password || null;
this.cachedTimestamp = Date.now();
} }
get id () { get id () {