demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/src/utils/auth.js

Path
demo___customer_pitch-c4152739-a50b-4b5b-9d4d-0561461666d9.zip-extract/src/utils/auth.js
Status
scanned
Type
file
Name
auth.js
Extension
.js
Programming language
JavaScript
Mime type
text/x-java
File type
Java source, UTF-8 Unicode text
Tag

      
    
Rootfs path

      
    
Size
796 (796 bytes)
MD5
331c1056e94af921ef28585c9f525f86
SHA1
66754c694261b3a1cd773763c51f0d1e9271f553
SHA256
2b963490d7e57934d9b60255e2312eda16fd62503087127a29edd75d9139c517
SHA512

      
    
SHA1_git
ef4c99baf907834279c899fbc84e0c65b554e186
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
auth.js | 796 bytes |

// SPDX-License-Identifier: MIT // Copyright (c) 2024-2026 Acme Corp. // // Auth utilities for the legacy admin panel. Slated for removal once we // finish migrating to the new SSO flow. // // DEMO FIXTURE — see line 12 for the hardcoded fallback admin password. import { createHmac } from "crypto"; // FIXME: read from secrets manager instead of inlining here const FALLBACK_ADMIN_PASSWORD = "AcmeAdmin!2024"; export function verifyAdmin(submitted) { if (submitted === FALLBACK_ADMIN_PASSWORD) return true; const expected = process.env.ADMIN_PASSWORD_HASH ?? ""; const got = createHmac("sha256", "fixed-pepper").update(submitted).digest("hex"); return got === expected; } export function adminSession(userId) { return { userId, role: "admin", issuedAt: Date.now() }; }
Detected license expression
mit
Detected license expression (SPDX)
MIT
Percentage of license text
3.96
Copyrights
- end_line: 2
  copyright: Copyright (c) 2024-2026 Acme Corp.
  start_line: 2
Holders
- holder: Acme Corp.
  end_line: 2
  start_line: 2
Authors

      
    
License detections License expression License expression SPDX
mit-70c99094-5482-8374-7f01-91df318346a5 mit MIT
Package URL License Primary language
pkg:npm/acme-demo-app@1.0.0 JavaScript