Bläddra i källkod

authentication model

tags/0.0.1^2
diaseu 3 år sedan
förälder
incheckning
d8f16442cd
2 ändrade filer med 15 tillägg och 1 borttagningar
  1. 14
    0
      backend/lib/models/authentication.js
  2. 1
    1
      backend/lib/schemas/authentication.js

+ 14
- 0
backend/lib/models/authentication.js Visa fil

1
+const Schwifty = require('@hapipal/schwifty')
2
+const Joi = require('joi')
3
+
4
+module.exports = class userAuth extends Schwifty.Model {
5
+    static get tableName() {
6
+        return 'authentication'
7
+    }
8
+    static get joiSchema() {
9
+        return Joi.object({
10
+            user_email: Joi.string().required(),
11
+            token: Joi.string().required()
12
+        })
13
+    }
14
+}

+ 1
- 1
backend/lib/schemas/authentication.js Visa fil

6
     user_email: Joi.string(),
6
     user_email: Joi.string(),
7
     created_at: Joi.date(),
7
     created_at: Joi.date(),
8
     updated_at: Joi.date(),
8
     updated_at: Joi.date(),
9
-    saltedhash: Joi.string()
9
+    token: Joi.string()
10
 }).label('user_auth')
10
 }).label('user_auth')
11
 
11
 
12
 module.exports = {
12
 module.exports = {

Laddar…
Avbryt
Spara