mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-18 04:35:10 +00:00
Some basic shell
This commit is contained in:
23
app/auth/db.js
Normal file
23
app/auth/db.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// WARNING: THIS HELPER FILE IS NOT GOOD PRACTICE AND ONLY HERE FOR CONVENIENCE
|
||||
// use a real database for persisting users instead
|
||||
|
||||
// const Users = [{
|
||||
// username: 'general-zod',
|
||||
// email: 'general.zod@krypton.com',
|
||||
// hash: '',
|
||||
// }, {
|
||||
// username: 'kal-el',
|
||||
// email: 'kal-el@krypton.com',
|
||||
// hash: '',
|
||||
// }];
|
||||
const Users = [];
|
||||
|
||||
export default {
|
||||
find(key, value) {
|
||||
return Users.find(user => user[key] === value);
|
||||
},
|
||||
add(user) {
|
||||
Users.push(user);
|
||||
return user;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user