MCPcopy Index your code
hub / github.com/coder/code-server / getPasswordMethod

Function getPasswordMethod

src/node/util.ts:189–201  ·  view source on GitHub ↗
(hashedPassword: string | undefined)

Source from the content-addressed store, hash-verified

187 * @returns {PasswordMethod} "SHA256" | "ARGON2" | "PLAIN_TEXT"
188 */
189export function getPasswordMethod(hashedPassword: string | undefined): PasswordMethod {
190 if (!hashedPassword) {
191 return "PLAIN_TEXT"
192 }
193
194 // This is the new hashing algorithm
195 if (hashedPassword.includes("$argon")) {
196 return "ARGON2"
197 }
198
199 // This is the legacy hashing algorithm
200 return "SHA256"
201}
202
203type PasswordValidation = {
204 isPasswordValid: boolean

Callers 2

authenticatedFunction · 0.90
login.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected