chore: server code formatting
This commit is contained in:
parent
aedabcbdee
commit
68517170e2
234 changed files with 9824 additions and 6195 deletions
|
|
@ -3,7 +3,7 @@ const crypto = require('crypto')
|
|||
const constants = require('./constants')
|
||||
const db = require('./db')
|
||||
|
||||
function createAuthToken (userID, type) {
|
||||
function createAuthToken(userID, type) {
|
||||
const token = crypto.randomBytes(32).toString('hex')
|
||||
const sql = `INSERT INTO auth_tokens (token, type, user_id) VALUES ($1, $2, $3) ON CONFLICT (user_id, type) DO UPDATE SET token=$1, expire=now() + interval '${constants.AUTH_TOKEN_EXPIRATION_TIME}' RETURNING *`
|
||||
|
||||
|
|
@ -11,5 +11,5 @@ function createAuthToken (userID, type) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
createAuthToken
|
||||
createAuthToken,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue