fix sign/verify secret typing
This commit is contained in:
committed by
Toby Schneider
parent
8a75c24253
commit
7468a3e102
@@ -143,7 +143,7 @@ const algorithms: JwtAlgorithms = {
|
||||
* @throws {Error} If there"s a validation issue.
|
||||
* @returns {Promise<string>} Returns token as a `string`.
|
||||
*/
|
||||
export async function sign<Payload = {}, Header = {}>(payload: JwtPayload<Payload>, secret: string | JsonWebKey, options: JwtSignOptions<Header> | JwtAlgorithm = "HS256"): Promise<string> {
|
||||
export async function sign<Payload = {}, Header = {}>(payload: JwtPayload<Payload>, secret: string | JsonWebKey | CryptoKey, options: JwtSignOptions<Header> | JwtAlgorithm = "HS256"): Promise<string> {
|
||||
if (typeof options === "string")
|
||||
options = { algorithm: options }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user