mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-06-30 16:40:05 +08:00
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:
@@ -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;
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user