Since we are about to release it's time to finally fix our linting. This patch basically runs eslint --fix and does some further manual fixes. Also it sets up eslint to fail on every warning on order to make warnings visable in the CI process. There should no functional change be introduced. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
		
			
				
	
	
		
			33 lines
		
	
	
		
			1023 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1023 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict'
 | |
| 
 | |
| const Router = require('express').Router
 | |
| const passport = require('passport')
 | |
| const GithubStrategy = require('passport-github').Strategy
 | |
| const config = require('../../../config')
 | |
| const response = require('../../../response')
 | |
| const { setReturnToFromReferer, passportGeneralCallback } = require('../utils')
 | |
| 
 | |
| let githubAuth = module.exports = Router()
 | |
| 
 | |
| passport.use(new GithubStrategy({
 | |
|   clientID: config.github.clientID,
 | |
|   clientSecret: config.github.clientSecret,
 | |
|   callbackURL: config.serverURL + '/auth/github/callback'
 | |
| }, passportGeneralCallback))
 | |
| 
 | |
| githubAuth.get('/auth/github', function (req, res, next) {
 | |
|   setReturnToFromReferer(req)
 | |
|   passport.authenticate('github')(req, res, next)
 | |
| })
 | |
| 
 | |
| // github auth callback
 | |
| githubAuth.get('/auth/github/callback',
 | |
|   passport.authenticate('github', {
 | |
|     successReturnToOrRedirect: config.serverURL + '/',
 | |
|     failureRedirect: config.serverURL + '/'
 | |
|   })
 | |
| )
 | |
| 
 | |
| // github callback actions
 | |
| githubAuth.get('/auth/github/callback/:noteId/:action', response.githubActions)
 |