diff --git a/app/src/components/AuthenticationPart.vue b/app/src/components/AuthenticationPart.vue
index c9b8eb0..4f8c0be 100644
--- a/app/src/components/AuthenticationPart.vue
+++ b/app/src/components/AuthenticationPart.vue
@@ -129,7 +129,7 @@ const goBack = () => {
placeholder="Enter your email or username"
v-model="username"
@input="clearError"
- autofocus
+ autocomplete="username"
/>
@@ -142,6 +142,7 @@ const goBack = () => {
placeholder="Enter your email or username"
v-model="email"
@input="clearError"
+ autocomplete="email"
/>
diff --git a/server/src/auth/passwordStrategy.js b/server/src/auth/passwordStrategy.js
index 86b0b90..b89d18e 100644
--- a/server/src/auth/passwordStrategy.js
+++ b/server/src/auth/passwordStrategy.js
@@ -4,7 +4,9 @@ import User from '../models/user.js'
async function verifyPassword(username, password, done) {
try {
- const user = await User.findOne({ username })
+ const user = await User.findOne({
+ $or: [{ username }, { email: username }],
+ })
if (!user) {
return done(null, false, { message: 'Incorrect username.' })
}