Skip to content

Commit

Permalink
fix: Only update user when not loginas
Browse files Browse the repository at this point in the history
  • Loading branch information
Veikkosuhonen committed Oct 23, 2023
1 parent 5c70fe0 commit a06c058
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/controllers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { User } from '../db/models'
const loginRouter = Router()

loginRouter.get('/login', requireAuthenticated(), async (req: RequestWithUser, res) => {
await User.upsert(req.user!)
if (!req.loginAs) {
await User.upsert(req.user!)
}
res.send(req.user)
})

Expand Down

0 comments on commit a06c058

Please sign in to comment.