chore: method signatures for pkceChallengeFromVerifier method

This commit is contained in:
jamesgeorge007
2020-01-11 13:26:56 +05:30
parent 9e5a162d74
commit a4b89a2152

View File

@@ -114,7 +114,14 @@ const base64urlencode = (
.replace(/\+/g, "-")
.replace(/\//g, "_")
.replace(/=+$/, "");
// Return the base64-urlencoded sha256 hash for the PKCE challenge
/**
* Return the base64-urlencoded sha256 hash for the PKCE challenge
*
* @param {String} v - The randomly generated string
* @returns {String}
*/
const pkceChallengeFromVerifier = async v => {
const hashed = await sha256(v);
return base64urlencode(hashed);