-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,9 +246,10 @@ describe('$crypto', async () => { | |
email1 = await $crypto.emailVerify(token1); | ||
|
||
// Hash is 64 bytes in length. | ||
// User ID is 20 bytes in length. | ||
// Expire time is 10 bytes in length. | ||
// Plus byte length of base64-encoded email. | ||
expect($str.byteLength(token1)).toBeGreaterThan(74); | ||
expect($str.byteLength(token1)).toBeGreaterThan(94); | ||
expect(email1).toBe(emailAddress1); | ||
|
||
// --- | ||
|
@@ -258,20 +259,36 @@ describe('$crypto', async () => { | |
email2 = await $crypto.emailVerify(token2); | ||
|
||
// Hash is 64 bytes in length. | ||
// User ID is 20 bytes in length. | ||
// Expire time is 10 bytes in length. | ||
// Plus byte length of base64-encoded email. | ||
expect($str.byteLength(token2)).toBeGreaterThan(74); | ||
expect($str.byteLength(token2)).toBeGreaterThan(94); | ||
expect(email2).toBe(''); | ||
|
||
// --- | ||
|
||
const token3 = 'x!@#$%^&*()_+ha2VDat9sWwGf6WYNu8ToEWcfhTGK9dZG3CHQRvVKWsE72tWh6eaiCtFBgnmed4g1234567890', | ||
const token3 = 'x!@#$%^&*()_+00000000000000000123ha2VDat9sWwGf6WYNu8ToEWcfhTGK9dZG3CHQRvVKWsE72tWh6eaiCtFBgnmed4g1234567890', | ||
email3 = await $crypto.emailVerify(token3); | ||
|
||
// Hash is 64 bytes in length. | ||
// User ID is 20 bytes in length. | ||
// Expire time is 10 bytes in length. | ||
// Plus byte length of base64-encoded email. | ||
expect($str.byteLength(token3)).toBeGreaterThan(74); | ||
expect($str.byteLength(token3)).toBeGreaterThan(94); | ||
expect(email3).toBe(''); | ||
|
||
// --- | ||
|
||
const userId4 = 123, | ||
emailAddress4 = '[email protected]', | ||
token4 = await $crypto.emailToken(emailAddress4, userId4), | ||
email4 = await $crypto.emailVerify(token4, userId4); | ||
|
||
// Hash is 64 bytes in length. | ||
// User ID is 20 bytes in length. | ||
// Expire time is 10 bytes in length. | ||
// Plus byte length of base64-encoded email. | ||
expect($str.byteLength(token4)).toBeGreaterThan(94); | ||
expect(email4).toBe(emailAddress4); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters