Download src/lib/auth.ts from felix-fx/fx-1: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/felix-fx/fx-1/resolve/main/src/lib/auth.ts
- Command line
-
hf download hf://felix-fx/fx-1/src/lib/auth.ts
-
curl -L -o auth.ts https://huggingface.co/felix-fx/fx-1/resolve/main/src/lib/auth.ts
653 Bytes
| /** | |
| * Auth utility - uses Supabase Auth exclusively | |
| * Legacy custom encryption removed | |
| */ | |
| export function checkPasswordStrength(password: string): { score: number; feedback: string } { | |
| let score = 0; | |
| if (!password) return { score: 0, feedback: "فارغة" }; | |
| if (password.length >= 8) score++; | |
| if (/[A-Z]/.test(password)) score++; | |
| if (/[a-z]/.test(password)) score++; | |
| if (/[0-9]/.test(password)) score++; | |
| if (/[^A-Za-z0-9]/.test(password)) score++; | |
| let feedback = ""; | |
| if (score < 3) feedback = "ضعيفة"; | |
| else if (score < 5) feedback = "متوسطة"; | |
| else feedback = "قوية جداً"; | |
| return { score, feedback }; | |
| } | |