-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
235 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "stable" | ||
- 'stable' | ||
install: | ||
- npm i | ||
script: | ||
- npm run migrate | ||
- npm run test | ||
after_success: | ||
- npm run coverage | ||
notifications: | ||
email: false | ||
services: | ||
- postgresql | ||
before_script: | ||
- psql -c 'create database travis_ci_test;' -U postgres |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import GithubStrategy from 'passport-github'; | ||
import { GetSocialGithub } from '../callbackHandler'; | ||
/** | ||
* @author Jacques Nyilinkindi | ||
* @returns Github strategy | ||
*/ | ||
const Github = new GithubStrategy({ | ||
clientID: process.env.GITHUB_CLIENT_ID, | ||
clientSecret: process.env.GITHUB_CLIENT_SECRET, | ||
callbackURL: process.env.GITHUB_CALLBACK | ||
}, | ||
async (accessToken, refreshToken, profile, done) => { | ||
GetSocialGithub( | ||
accessToken, refreshToken, profile, done | ||
); | ||
}); | ||
export default Github; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import TwitterStrategy from 'passport-twitter'; | ||
import { GetSocialTwitter } from '../callbackHandler'; | ||
/** | ||
* @author Jacques Nyilinkindi | ||
* @returns Twitter strategy | ||
*/ | ||
const Twitter = new TwitterStrategy({ | ||
consumerKey: process.env.TWITTER_CONSUMER_KEY, | ||
consumerSecret: process.env.TWITTER_CONSUMER_SECRET, | ||
callbackURL: process.env.TWITTER_CALLBACK, | ||
}, | ||
async (token, tokenSecret, profile, done) => { | ||
GetSocialTwitter( | ||
token, tokenSecret, profile, done | ||
); | ||
}); | ||
export default Twitter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,42 @@ | ||
/* eslint-disable class-methods-use-this */ | ||
/** | ||
* @author frank harerimana | ||
* Generate unique username | ||
*/ | ||
class Generate { | ||
/** | ||
* @param {*} strings | ||
*/ | ||
constructor(strings) { | ||
this.strings = strings; | ||
* @author frank harerimana | ||
*/ | ||
constructor() { | ||
this.randomNumber = Math.floor(Math.random() * 10000); | ||
this.randomString = Math.random().toString(36).slice(2); | ||
} | ||
|
||
/** | ||
* @author frank harerimana | ||
* @param { String } name | ||
* @returns { String } username | ||
*/ | ||
getUsername() { | ||
return this.strings.replace(/\s/g, '-').toLowerCase() + this.randomNumber; | ||
getUsername(name) { | ||
return name.replace(/\s/g, '-').toLowerCase() + this.randomNumber; | ||
} | ||
|
||
/** | ||
* @author Jacques Nyilinkindi | ||
* @param { String } words | ||
* @returns { String } string | ||
*/ | ||
removeSpecialCharacters(words) { | ||
return words.replace(/[^a-zA-Z ]/g, '').trim(); | ||
} | ||
|
||
/** | ||
* @author Jacques Nyilinkindi | ||
* @param { String } image | ||
* @returns { String } string | ||
*/ | ||
generateLargeTwitterProfile(image) { | ||
return image.replace('_normal', ''); | ||
} | ||
} | ||
export default Generate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.