Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

bug fix

daniel31x13495509c888dc
diff --git a/components/InstallApp.tsx b/components/InstallApp.tsx
index f191f006..50071da6 100644
--- a/components/InstallApp.tsx
+++ b/components/InstallApp.tsx
@@ -8,7 +8,7 @@ const InstallApp = (props: Props) => {
const [isOpen, setIsOpen] = useState(true);
return isOpen && !isPWA() ? (
- <div className="fixed left-0 right-0 bottom-10 w-full p-5">
+ <div className="fixed left-0 right-0 bottom-10 w-full">
<div className="mx-auto w-fit p-2 flex justify-between gap-2 items-center border border-neutral-content rounded-xl bg-base-300 backdrop-blur-md bg-opacity-80 max-w-md">
<svg
xmlns="http://www.w3.org/2000/svg"
diff --git a/pages/api/v1/auth/[...nextauth].ts b/pages/api/v1/auth/[...nextauth].ts
index 7b6315f6..8b97c046 100644
--- a/pages/api/v1/auth/[...nextauth].ts
+++ b/pages/api/v1/auth/[...nextauth].ts
@@ -1179,14 +1179,14 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
},
callbacks: {
async signIn({ user, account, profile, email, credentials }) {
- if (account?.provider !== "credentials") {
+ if (account?.provider !== "credentials" && newSsoUsersDisabled) {
// registration via SSO can be separately disabled
const existingUser = await prisma.account.findFirst({
where: {
providerAccountId: account?.providerAccountId,
},
});
- if (!existingUser && newSsoUsersDisabled) {
+ if (!existingUser) {
return false;
}
}
@@ -1217,6 +1217,22 @@ export default async function auth(req: NextApiRequest, res: NextApiResponse) {
},
});
}
+ } else if (trigger === "signIn") {
+ const user = await prisma.user.findUnique({
+ where: {
+ id: token.id,
+ },
+ });
+
+ if (user && !user.username) {
+ const autoGeneratedUsername =
+ "user" + Math.round(Math.random() * 1000000000);
+
+ await prisma.user.update({
+ where: { id: user.id },
+ data: { username: autoGeneratedUsername },
+ });
+ }
}
return token;