From 6b3a1b5cbbe6c52af5c9c1abbf9183fb35755bf2 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Wed, 11 Sep 2024 15:18:08 +0900 Subject: [PATCH] docs(basic/beaerer): add messages options --- docs/middleware/builtin/basic-auth.md | 4 ++++ docs/middleware/builtin/bearer-auth.md | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/docs/middleware/builtin/basic-auth.md b/docs/middleware/builtin/basic-auth.md index d463c974..b1808060 100644 --- a/docs/middleware/builtin/basic-auth.md +++ b/docs/middleware/builtin/basic-auth.md @@ -87,6 +87,10 @@ A function to handle hashing for safe comparison of passwords. The function to verify the user. +### invalidUserMessage: `string | object | MessageFunction` + +`MessageFunction` is `(c: Context) => string | object | Promise`. The custom message if the user is invalid. + ## More Options ### ...users: `{ username: string, password: string }[]` diff --git a/docs/middleware/builtin/bearer-auth.md b/docs/middleware/builtin/bearer-auth.md index 9387c722..c1c82ab8 100644 --- a/docs/middleware/builtin/bearer-auth.md +++ b/docs/middleware/builtin/bearer-auth.md @@ -110,3 +110,15 @@ A function to handle hashing for safe comparison of authentication tokens. ### verifyToken: `(token: string, c: Context) => boolean | Promise` The function to verify the token. + +### noAuthenticationHeaderMessage: `string | object | MessageFunction` + +`MessageFunction` is `(c: Context) => string | object | Promise`. The custom message if it does not have an authentication header. + +### invalidAuthenticationHeaderMessage: `string | object | MessageFunction` + +The custom message if the authentication header is invalid. + +### invalidTokenMessage: `string | object | MessageFunction` + +The custom message if the token is invalid.