Never update account if multi auth is used

This commit is contained in:
ekzyis 2023-11-21 02:59:05 +01:00
parent 0caa517cd5
commit 9baf5063e1
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,8 @@ async function pubkeyAuth (credentials, req, res, pubkeyColumnName) {
const token = await getToken({ req })
if (!user) {
// if we are logged in, update rather than create
if (token?.id) {
// never update account if multi auth is used, only create
if (token?.id && !multiAuth) {
// TODO: consider multi auth if logged in but user does not exist yet
user = await prisma.user.update({ where: { id: token.id }, data: { [pubkeyColumnName]: pubkey } })
} else {