fix: sanitize password and cookie key
This commit is contained in:
@ -7,6 +7,7 @@ import {
|
||||
hashLegacy,
|
||||
isHashLegacyMatch,
|
||||
isCookieValid,
|
||||
sanitizeString,
|
||||
} from "../../../src/node/util"
|
||||
|
||||
describe("getEnvPaths", () => {
|
||||
@ -382,3 +383,15 @@ describe.only("isCookieValid", () => {
|
||||
expect(isValid).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe.only("sanitizeString", () => {
|
||||
it("should return an empty string if passed a type other than a string", () => {
|
||||
expect(sanitizeString({} as string)).toBe("")
|
||||
})
|
||||
it("should trim whitespace", () => {
|
||||
expect(sanitizeString(" hello ")).toBe("hello")
|
||||
})
|
||||
it("should always return an empty string", () => {
|
||||
expect(sanitizeString(" ")).toBe("")
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user