diff --git a/package-lock.json b/package-lock.json index 121245d..edaa3eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mock-data-api-nextjs", - "version": "1.1.0", + "version": "1.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "mock-data-api-nextjs", - "version": "1.1.0", + "version": "1.2.0", "dependencies": { "axios": "1.2.1", "chance": "^1.1.9", diff --git a/package.json b/package.json index 912fe6f..2cd5ec4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mock-data-api-nextjs", - "version": "1.1.0", + "version": "1.2.0", "private": false, "scripts": { "dev": "next dev -p 3010", diff --git a/src/data/users.json b/src/data/users.json index 67ce7c1..23cfb1d 100644 --- a/src/data/users.json +++ b/src/data/users.json @@ -1,8 +1,10 @@ [ - { "id": "5e86809283e28b96d2d38537", "email": "info@codedthemes.com", "password": "123456", "name": "JWT User" }, - { "id": "5e87809273e28b96d2e38538", "email": "info@phoenixcoded.co", "password": "123456", "name": "JWT User" }, - { "id": "344353656373", "email": "milanbhikadiya22@gmail.com", "password": "123456", "name": "Milan Bhikadiya" }, - { "id": "61d81b3d", "email": "milanbhikadiya@gmail.com", "password": "123456", "name": "Milan Bhikadiya" }, - { "id": "774598e0", "email": "test@test.com", "password": "Test1234", "name": "New Test" }, - { "id": "9571bb3a", "email": "amit@phoenixcoded.co", "password": "aA@123456", "name": "Amit Gorasiya" } + { "id": "5e86809283e28b96d2d38537", "email": "info@codedthemes.com", "password": "123456", "name": "JWT User", "role": "Admin" }, + { "id": "5e87809273e28b96d2e38538", "email": "info@phoenixcoded.co", "password": "123456", "name": "JWT User", "role": "Admin" }, + { "id": "344353656373", "email": "milanbhikadiya22@gmail.com", "password": "123456", "name": "Milan Bhikadiya", "role": "Admin" }, + { "id": "61d81b3d", "email": "milanbhikadiya@gmail.com", "password": "123456", "name": "Milan Bhikadiya", "role": "Admin" }, + { "id": "774598e0", "email": "test@test.com", "password": "Test1234", "name": "New Test", "role": "Admin" }, + { "id": "9571bb3a", "email": "amit@phoenixcoded.co", "password": "aA@123456", "name": "Amit Gorasiya", "role": "Admin" }, + { "id": "5648ww9g", "email": "admin@gmail.com", "password": "Admin@123", "name": "Admin User", "role": "Admin" }, + { "id": "9654cc9d", "email": "user@gmail.com", "password": "User@123", "name": "John Challis", "role": "User" } ] diff --git a/src/pages/api/account/login.js b/src/pages/api/account/login.js index 81e20ee..deeff26 100644 --- a/src/pages/api/account/login.js +++ b/src/pages/api/account/login.js @@ -29,7 +29,8 @@ export default async function handler(req, res) { user: { id: user.id, email: user.email, - name: user.name + name: user.name, + role: user.role } }); } diff --git a/src/pages/api/account/register.js b/src/pages/api/account/register.js index f591626..242ac0d 100644 --- a/src/pages/api/account/register.js +++ b/src/pages/api/account/register.js @@ -23,7 +23,8 @@ export default async function handler(req, res) { id, email, password, - name: `${firstName} ${lastName}` + name: `${firstName} ${lastName}`, + role: 'User' }; users.push(user);