-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinal.ts
More file actions
27 lines (25 loc) · 933 Bytes
/
final.ts
File metadata and controls
27 lines (25 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import type { Context } from "hono";
/**
* This function is executed when the OTP and credential (e.g. email, phone number...) have been successfully verified.
*
* Customize this function as you like.
*
* @async
* @function
* @param {Context} c - Hono context.
* @param {string} credential - Client credential/ID previously passed in `credential.ts`.
* @returns {Promise<Response>} [Hono Response using the Hono context](https://hono.dev/docs/getting-started/basic#return-json).
*/
export default async function finalAction(c: Context, credential: string) {
/**
* For passwordless authentication:
* You might want to generate a JWT or session cookie here and return it to the client.
*
* For credential verification:
* You might want to mark the credential (e.g. email, phone number...) as "verified" in your database.
*/
return c.json({
credential,
message: "successfully verified"
});
}