File size: 903 Bytes
14356bb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
 * credentials.js
 * ==============
 * Authorised login accounts for Genesis AI dashboard.
 *
 * TO ADD A NEW USER  — add an entry to the USERS array below.
 * TO CHANGE PASSWORD — update the password field for the relevant email.
 * TO REMOVE A USER   — delete their entry from the array.
 *
 * Format:
 *   { email: "user@dabur.com", password: "yourpassword", name: "Display Name" }
 */

export const USERS = [
  {
    email:    "sohini.bera@dabur.com",
    password: "Chocolate",
    name:     "Sohini Bera",
  },
  {
    email:    "pricing.analyst@dabur.com",
    password: "1234",
    name:     "Pricing Analyst",
  }, 
]

/**
 * Returns the user object if credentials match, otherwise null.
 */
export function authenticate(email, password) {
  const e = email.trim().toLowerCase()
  const p = password
  return USERS.find(u => u.email.toLowerCase() === e && u.password === p) || null
}