fix unused variables
parent
33db934cf6
commit
b5e9e94944
|
@ -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()
|
||||
})
|
||||
|
|
42
app.js
42
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'))
|
||||
|
|
|
@ -55,7 +55,7 @@ export const checkEmail = email => async (dispatch, getState) => {
|
|||
dispatch(clearError())
|
||||
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
|
||||
|
@ -82,7 +82,7 @@ export const checkPassword = (email, password) => async (dispatch, getState) =>
|
|||
|
||||
// do email + password check
|
||||
try {
|
||||
const res = await Ajax.post({
|
||||
await Ajax.post({
|
||||
url: '/auth/local',
|
||||
data: {
|
||||
identifier: email,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
import React from 'react'
|
||||
|
||||
import STYLE from '../../styles/shared/underlineinput.scss'
|
||||
import '../../styles/shared/underlineinput.scss'
|
||||
|
||||
const UnderlineInput = props => (
|
||||
<div className='underlined-input'>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
import React from 'react'
|
||||
import STYLE from '../../styles/shared/carousel.scss'
|
||||
import '../../styles/shared/carousel.scss'
|
||||
|
||||
class Carousel extends React.Component {
|
||||
constructor () {
|
||||
|
|
|
@ -8,7 +8,7 @@ import UnderlineInput from './components/UnderlineInput'
|
|||
import reducer from './reducers/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 {
|
||||
constructor () {
|
||||
|
|
10
package.json
10
package.json
|
@ -32,6 +32,7 @@
|
|||
"@babel/polyfill": "^7.0.0",
|
||||
"@babel/preset-env": "^7.1.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.4",
|
||||
"css-loader": "^1.0.1",
|
||||
"eslint": "^5.8.0",
|
||||
|
@ -76,7 +77,12 @@
|
|||
},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"sails"
|
||||
]
|
||||
"sails",
|
||||
"User",
|
||||
"Book",
|
||||
"Passport",
|
||||
"_"
|
||||
],
|
||||
"parser": "babel-eslint"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue