Register: auto sign-in to /me and speed/cleanup improvements
- Send the verification email after the response via after() so it never blocks sign-up - Invalidate the cached login lookup right after account creation so the automatic sign-in always finds the fresh row - Auto sign in with the submitted credentials and go straight to /me, with a fallback to /login?registered=1 if sign-in is refused (e.g. email verification required) - Cache the register page's online/latest user queries to cut DB load under traffic - Fix terms checkbox label double-toggle cancelling the selection - Add pages.register.redirecting translation to all locales
This commit is contained in:
1 parent
2d09a4a92c
commit
f25a26a93e
25 files changed
+143
-53
No files matched your search
@@ -33,18 +33,20 @@ export default async function RegisterPage() {
|
||||
.where(eq(User.online, "1"))
|
||||
.then((rows) => rows[0]?.total ?? 0),
|
||||
).catch(() => 0),
|
||||
db
|
||||
.select({ username: User.username, look: User.look })
|
||||
.from(User)
|
||||
.where(eq(User.online, "1"))
|
||||
.limit(8)
|
||||
.catch(() => []),
|
||||
db
|
||||
.select({ username: User.username, look: User.look })
|
||||
.from(User)
|
||||
.orderBy(desc(User.accountCreated))
|
||||
.limit(8)
|
||||
.catch(() => []),
|
||||
cached("register_online_users", 10_000, () =>
|
||||
db
|
||||
.select({ username: User.username, look: User.look })
|
||||
.from(User)
|
||||
.where(eq(User.online, "1"))
|
||||
.limit(8),
|
||||
).catch(() => []),
|
||||
cached("register_latest_users", 30_000, () =>
|
||||
db
|
||||
.select({ username: User.username, look: User.look })
|
||||
.from(User)
|
||||
.orderBy(desc(User.accountCreated))
|
||||
.limit(8),
|
||||
).catch(() => []),
|
||||
]);
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user