fix unused variables

pull/20/head
unknown 2018-11-07 15:27:07 -05:00
parent 33db934cf6
commit b5e9e94944
7 changed files with 33 additions and 31 deletions

View File

@ -114,7 +114,7 @@ function PassportHelper () {
if (profile.emails && profile.emails[0]) { userAttrs.email = profile.emails[0].value } if (profile.emails && profile.emails[0]) { userAttrs.email = profile.emails[0].value }
if (!userAttrs.email) { return next(new Error('No email available')) } if (!userAttrs.email) { return next(new Error('No email available')) }
const pass = await Passport.findOne({ const passport = await Passport.findOne({
provider, provider,
identifier: q.identifier.toString() identifier: q.identifier.toString()
}) })

42
app.js
View File

@ -20,35 +20,31 @@
* https://sailsjs.com/anatomy/app.js * https://sailsjs.com/anatomy/app.js
*/ */
// Ensure we're in the project directory, so cwd-relative paths work as expected // Ensure we're in the project directory, so cwd-relative paths work as expected
// no matter where we actually lift from. // no matter where we actually lift from.
// > Note: This is not required in order to lift, but it is a convenient default. // > 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). // Attempt to import `sails` dependency, as well as `rc` (for loading `.sailsrc` files).
var sails; var sails
var rc; var rc
try { try {
sails = require('sails'); sails = require('sails')
rc = require('sails/accessible/rc'); rc = require('sails/accessible/rc')
} catch (err) { } catch (err) {
console.error('Encountered an error when attempting to require(\'sails\'):'); console.error('Encountered an error when attempting to require(\'sails\'):')
console.error(err.stack); console.error(err.stack)
console.error('--'); console.error('--')
console.error('To run an app using `node app.js`, you need to have Sails installed'); 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('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('in the same directory as your app and run `npm install`.')
console.error(); console.error()
console.error('If Sails is installed globally (i.e. `npm install -g sails`) you can'); 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('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('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.)'); console.error('(It even uses your app directory\'s local Sails install, if possible.)')
return; return
}//-• }// -•
// Start server // Start server
sails.lift(rc('sails')); sails.lift(rc('sails'))

View File

@ -55,7 +55,7 @@ export const checkEmail = email => async (dispatch, getState) => {
dispatch(clearError()) 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 { try {
const res = await Ajax.post({ await Ajax.post({
url: '/auth/email_exists', url: '/auth/email_exists',
data: { data: {
email email
@ -82,7 +82,7 @@ export const checkPassword = (email, password) => async (dispatch, getState) =>
// do email + password check // do email + password check
try { try {
const res = await Ajax.post({ await Ajax.post({
url: '/auth/local', url: '/auth/local',
data: { data: {
identifier: email, identifier: email,

View File

@ -2,7 +2,7 @@
import React from 'react' import React from 'react'
import STYLE from '../../styles/shared/underlineinput.scss' import '../../styles/shared/underlineinput.scss'
const UnderlineInput = props => ( const UnderlineInput = props => (
<div className='underlined-input'> <div className='underlined-input'>

View File

@ -1,7 +1,7 @@
'use strict' 'use strict'
import React from 'react' import React from 'react'
import STYLE from '../../styles/shared/carousel.scss' import '../../styles/shared/carousel.scss'
class Carousel extends React.Component { class Carousel extends React.Component {
constructor () { constructor () {

View File

@ -8,7 +8,7 @@ import UnderlineInput from './components/UnderlineInput'
import reducer from './reducers/login' import reducer from './reducers/login'
import {setEmail, setPassword, setCarousel, checkEmail, checkPassword, signup} from './actions/login' import {setEmail, setPassword, setCarousel, checkEmail, checkPassword, signup} from './actions/login'
import STYLE from '../styles/login.scss' import '../styles/login.scss'
class App extends React.Component { class App extends React.Component {
constructor () { constructor () {

View File

@ -32,6 +32,7 @@
"@babel/polyfill": "^7.0.0", "@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.1.0", "@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0", "@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.4", "babel-loader": "^8.0.4",
"css-loader": "^1.0.1", "css-loader": "^1.0.1",
"eslint": "^5.8.0", "eslint": "^5.8.0",
@ -76,7 +77,12 @@
}, },
"standard": { "standard": {
"globals": [ "globals": [
"sails" "sails",
] "User",
"Book",
"Passport",
"_"
],
"parser": "babel-eslint"
} }
} }