diff --git a/.travis.yml b/.travis.yml index 5a85838..00c71d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,4 +15,4 @@ deploy: before_script: - npm install -script: npm run lint && npm run custom-tests && echo 'Done.' +script: npm test diff --git a/api/helpers/passport.js b/api/helpers/passport.js index 081f73c..3af349e 100644 --- a/api/helpers/passport.js +++ b/api/helpers/passport.js @@ -23,7 +23,7 @@ passport.serializeUser((user, next) => { next(null, user.id) }) passport.deserializeUser((id, next) => { - return User.findOne({id: id}) + return User.findOne({ id: id }) .then((user) => { next(null, user) return user @@ -37,7 +37,7 @@ function PassportHelper () { const strategies = sails.config.passport for (const key in strategies) { - let options = {passReqToCallback: true} + let options = { passReqToCallback: true } let Strategy = strategies[key].strategy if (key === 'local') { _.extend(options, { @@ -114,7 +114,7 @@ function PassportHelper () { if (profile.emails && profile.emails[0]) { userAttrs.email = profile.emails[0].value } if (!userAttrs.email) { return next(new Error('No email available')) } - const pass = await Passport.findOne({ + const passport = await Passport.findOne({ provider, identifier: q.identifier.toString() }) diff --git a/api/models/Book.js b/api/models/Book.js index 7971f47..11962de 100644 --- a/api/models/Book.js +++ b/api/models/Book.js @@ -17,10 +17,10 @@ module.exports = { unique: true, autoIncrement: true }, - title: {type: 'string', required: true}, - author: {type: 'string'}, - isbn: {type: 'string'}, - version: {type: 'string'} + title: { type: 'string', required: true }, + author: { type: 'string' }, + isbn: { type: 'string' }, + version: { type: 'string' } // ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗ // ║╣ ║║║╠╩╗║╣ ║║╚═╗ diff --git a/app.js b/app.js index f2c5f4e..edcec41 100644 --- a/app.js +++ b/app.js @@ -20,35 +20,31 @@ * https://sailsjs.com/anatomy/app.js */ - // Ensure we're in the project directory, so cwd-relative paths work as expected // no matter where we actually lift from. // > Note: This is not required in order to lift, but it is a convenient default. -process.chdir(__dirname); - - +process.chdir(__dirname) // Attempt to import `sails` dependency, as well as `rc` (for loading `.sailsrc` files). -var sails; -var rc; +var sails +var rc try { - sails = require('sails'); - rc = require('sails/accessible/rc'); + sails = require('sails') + rc = require('sails/accessible/rc') } catch (err) { - console.error('Encountered an error when attempting to require(\'sails\'):'); - console.error(err.stack); - console.error('--'); - console.error('To run an app using `node app.js`, you need to have Sails installed'); - console.error('locally (`./node_modules/sails`). To do that, just make sure you\'re'); - console.error('in the same directory as your app and run `npm install`.'); - console.error(); - console.error('If Sails is installed globally (i.e. `npm install -g sails`) you can'); - console.error('also run this app with `sails lift`. Running with `sails lift` will'); - console.error('not run this file (`app.js`), but it will do exactly the same thing.'); - console.error('(It even uses your app directory\'s local Sails install, if possible.)'); - return; -}//-• - + console.error('Encountered an error when attempting to require(\'sails\'):') + console.error(err.stack) + console.error('--') + console.error('To run an app using `node app.js`, you need to have Sails installed') + console.error('locally (`./node_modules/sails`). To do that, just make sure you\'re') + console.error('in the same directory as your app and run `npm install`.') + console.error() + console.error('If Sails is installed globally (i.e. `npm install -g sails`) you can') + console.error('also run this app with `sails lift`. Running with `sails lift` will') + console.error('not run this file (`app.js`), but it will do exactly the same thing.') + console.error('(It even uses your app directory\'s local Sails install, if possible.)') + return +}// -• // Start server -sails.lift(rc('sails')); +sails.lift(rc('sails')) diff --git a/assets/js/actions/login.js b/assets/js/actions/login.js index c35e747..5d690f1 100644 --- a/assets/js/actions/login.js +++ b/assets/js/actions/login.js @@ -53,9 +53,9 @@ export const setLoggedIn = (data) => (dispatch, getState) => { export const checkEmail = email => async (dispatch, getState) => { dispatch(setWorking(true)) dispatch(clearError()) - if (/^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/.test(email)) { + if (/^([a-zA-Z0-9_\-.]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,5})$/.test(email)) { try { - const res = await Ajax.post({ + await Ajax.post({ url: '/auth/email_exists', data: { email @@ -103,7 +103,7 @@ export const checkPassword = (email, password) => async (dispatch, getState) => export const signup = (email, password) => async (dispatch, getState) => { dispatch(setWorking(true)) dispatch(clearError()) - if (/^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/.test(email)) { + if (/^([a-zA-Z0-9_\-.]+)@([a-zA-Z0-9_\-.]+)\.([a-zA-Z]{2,5})$/.test(email)) { try { await Ajax.post({ url: '/auth/email_available', diff --git a/assets/js/components/UnderlineInput.js b/assets/js/components/UnderlineInput.js index 0281a6a..2a5aeda 100644 --- a/assets/js/components/UnderlineInput.js +++ b/assets/js/components/UnderlineInput.js @@ -2,7 +2,7 @@ import React from 'react' -import STYLE from '../../styles/shared/underlineinput.scss' +import '../../styles/shared/underlineinput.scss' const UnderlineInput = props => (