add user routes
This commit is contained in:
@@ -112,6 +112,7 @@ export async function webAuthnRoutes(fastify: FastifyInstance) {
|
||||
return res.code(400).send({ error: "registration failed" });
|
||||
}
|
||||
|
||||
userInDB.status = "active";
|
||||
userInDB.passKeys.push({
|
||||
credentialID: verification.registrationInfo.credential.id,
|
||||
credentialPublicKey:
|
||||
@@ -238,6 +239,9 @@ export async function webAuthnRoutes(fastify: FastifyInstance) {
|
||||
req.headers["user-agent"]
|
||||
);
|
||||
|
||||
userInDB.lastLogin = new Date();
|
||||
await userInDB.save();
|
||||
|
||||
res.send({ session_token: newSession.sid });
|
||||
} catch (error) {
|
||||
res.code(400).send({ error: (error as Error).message });
|
||||
|
||||
Reference in New Issue
Block a user