Merge pull request #210 from LAION-AI/168-cant-fetch-tasks-when-logging-in-as-a-debug-users

saving user to the dabase when using the debug credentials provider
This commit is contained in:
Desmond Grealy
2022-12-31 15:20:04 -08:00
committed by GitHub
+10 -1
View File
@@ -43,10 +43,19 @@ if (boolean(process.env.DEBUG_LOGIN) || process.env.NODE_ENV === "development")
username: { label: "Username", type: "text" },
},
async authorize(credentials) {
return {
const user = {
id: credentials.username,
name: credentials.username,
};
// save the user to the database
await prisma.user.upsert({
where: {
id: user.id,
},
update: {},
create: user,
});
return user;
},
})
);