Merge remote-tracking branch 'origin/generator'
* origin/generator: (23 commits) Instagram generator indentation and whitespace fixes Minor adjustments to instagram generator, changed log color of already active auth methods to grey. (from yellow) Instagram auth generator! Renamed minimizer.js to generator.js Added Local authentication generator Removed if-check for local auth on change password form Added LinkedIn authentication generator Added Twitter authentication generator Added GitHub authentication generator Prettified generator CLI with unicode icons and multi-line message. Added Google add/remove generator Generator code cleanup Generator code refactoring Updated comment style to make it easier to generate the code using multiline strings Facebook User model add/remove complete add/remove facebook from profile template complete Removed auth if-checks Added login.jade add/remove facebook auth Removed if-checks, all authentications enabled by default Added terminal colors, info messages + code refactoring. ...
This commit is contained in:
@ -21,9 +21,7 @@ passport.deserializeUser(function(id, done) {
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Sign in using Email and Password.
|
||||
*/
|
||||
// Sign in using Email and Password.
|
||||
|
||||
passport.use(new LocalStrategy({ usernameField: 'email' }, function(email, password, done) {
|
||||
User.findOne({ email: email }, function(err, user) {
|
||||
@ -53,9 +51,7 @@ passport.use(new LocalStrategy({ usernameField: 'email' }, function(email, passw
|
||||
* - Else create a new account.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sign in with Facebook.
|
||||
*/
|
||||
// Sign in with Facebook.
|
||||
|
||||
passport.use(new FacebookStrategy(secrets.facebook, function(req, accessToken, refreshToken, profile, done) {
|
||||
if (req.user) {
|
||||
@ -102,9 +98,7 @@ passport.use(new FacebookStrategy(secrets.facebook, function(req, accessToken, r
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* Sign in with GitHub.
|
||||
*/
|
||||
// Sign in with GitHub.
|
||||
|
||||
passport.use(new GitHubStrategy(secrets.github, function(req, accessToken, refreshToken, profile, done) {
|
||||
if (req.user) {
|
||||
@ -152,9 +146,7 @@ passport.use(new GitHubStrategy(secrets.github, function(req, accessToken, refre
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* Sign in with Twitter.
|
||||
*/
|
||||
// Sign in with Twitter.
|
||||
|
||||
passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tokenSecret, profile, done) {
|
||||
if (req.user) {
|
||||
@ -197,9 +189,7 @@ passport.use(new TwitterStrategy(secrets.twitter, function(req, accessToken, tok
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* Sign in with Google.
|
||||
*/
|
||||
// Sign in with Google.
|
||||
|
||||
passport.use(new GoogleStrategy(secrets.google, function(req, accessToken, refreshToken, profile, done) {
|
||||
if (req.user) {
|
||||
@ -245,9 +235,7 @@ passport.use(new GoogleStrategy(secrets.google, function(req, accessToken, refre
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* Sign in with LinkedIn.
|
||||
*/
|
||||
// Sign in with LinkedIn.
|
||||
|
||||
passport.use(new LinkedInStrategy(secrets.linkedin, function(req, accessToken, refreshToken, profile, done) {
|
||||
if (req.user) {
|
||||
@ -298,10 +286,7 @@ passport.use(new LinkedInStrategy(secrets.linkedin, function(req, accessToken, r
|
||||
}
|
||||
}));
|
||||
|
||||
/**
|
||||
* Tumblr API
|
||||
* Uses OAuth 1.0a Strategy.
|
||||
*/
|
||||
// Tumblr API setup.
|
||||
|
||||
passport.use('tumblr', new OAuthStrategy({
|
||||
requestTokenURL: 'http://www.tumblr.com/oauth/request_token',
|
||||
@ -322,10 +307,7 @@ passport.use('tumblr', new OAuthStrategy({
|
||||
}
|
||||
));
|
||||
|
||||
/**
|
||||
* Foursquare API
|
||||
* Uses OAuth 2.0 Strategy.
|
||||
*/
|
||||
// Foursquare API setup.
|
||||
|
||||
passport.use('foursquare', new OAuth2Strategy({
|
||||
authorizationURL: 'https://foursquare.com/oauth2/authorize',
|
||||
@ -345,10 +327,7 @@ passport.use('foursquare', new OAuth2Strategy({
|
||||
}
|
||||
));
|
||||
|
||||
/**
|
||||
* Venmo API
|
||||
* Uses OAuth 2.0 Strategy.
|
||||
*/
|
||||
// Venmo API setup.
|
||||
|
||||
passport.use('venmo', new OAuth2Strategy({
|
||||
authorizationURL: 'https://api.venmo.com/v1/oauth/authorize',
|
||||
|
1099
generator.js
Normal file
1099
generator.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,36 +5,30 @@ block content
|
||||
legend Sign In
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
.col-sm-8.col-sm-offset-2
|
||||
if secrets.localAuth
|
||||
.form-group
|
||||
label.control-label(for='email') Email
|
||||
input.form-control(type='text', name='email', id='email', placeholder='Email', autofocus=true)
|
||||
.form-group
|
||||
label.control-label(for='password') Password
|
||||
input.form-control(type='password', name='password', id='password', placeholder='Password')
|
||||
.form-group
|
||||
button.btn.btn-primary(type='submit')
|
||||
i.fa.fa-unlock-alt
|
||||
| Login
|
||||
a.btn.btn-link(href='/forgot') Forgot your password?
|
||||
hr
|
||||
if secrets.facebookAuth
|
||||
a.btn.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
||||
i.fa.fa-facebook
|
||||
| Sign in with Facebook
|
||||
if secrets.twitterAuth
|
||||
a.btn.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
||||
i.fa.fa-twitter
|
||||
| Sign in with Twitter
|
||||
if secrets.googleAuth
|
||||
a.btn.btn-block.btn-google-plus.btn-social(href='/auth/google')
|
||||
i.fa.fa-google-plus
|
||||
| Sign in with Google
|
||||
if secrets.githubAuth
|
||||
a.btn.btn-block.btn-github.btn-social(href='/auth/github')
|
||||
i.fa.fa-github
|
||||
| Sign in with GitHub
|
||||
if secrets.linkedinAuth
|
||||
a.btn.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
||||
i.fa.fa-linkedin
|
||||
| Sign in with LinkedIn
|
||||
.form-group
|
||||
label.control-label(for='email') Email
|
||||
input.form-control(type='text', name='email', id='email', placeholder='Email', autofocus=true)
|
||||
.form-group
|
||||
label.control-label(for='password') Password
|
||||
input.form-control(type='password', name='password', id='password', placeholder='Password')
|
||||
.form-group
|
||||
button.btn.btn-primary(type='submit')
|
||||
i.fa.fa-unlock-alt
|
||||
| Login
|
||||
a.btn.btn-link(href='/forgot') Forgot your password?
|
||||
hr
|
||||
a.btn.btn-block.btn-facebook.btn-social(href='/auth/facebook')
|
||||
i.fa.fa-facebook
|
||||
| Sign in with Facebook
|
||||
a.btn.btn-block.btn-twitter.btn-social(href='/auth/twitter')
|
||||
i.fa.fa-twitter
|
||||
| Sign in with Twitter
|
||||
a.btn.btn-block.btn-google-plus.btn-social(href='/auth/google')
|
||||
i.fa.fa-google-plus
|
||||
| Sign in with Google
|
||||
a.btn.btn-block.btn-github.btn-social(href='/auth/github')
|
||||
i.fa.fa-github
|
||||
| Sign in with GitHub
|
||||
a.btn.btn-block.btn-linkedin.btn-social(href='/auth/linkedin')
|
||||
i.fa.fa-linkedin
|
||||
| Sign in with LinkedIn
|
||||
|
@ -41,26 +41,24 @@ block content
|
||||
i.fa.fa-magnet
|
||||
| Update Profile
|
||||
|
||||
.page-header
|
||||
h3 Change Password
|
||||
|
||||
if secrets.localAuth
|
||||
.page-header
|
||||
h3 Change Password
|
||||
|
||||
form.form-horizontal(action='/account/password', method='POST')
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
.form-group
|
||||
label.col-sm-3.control-label(for='password') New Password
|
||||
.col-sm-4
|
||||
input.form-control(type='password', name='password', id='password')
|
||||
.form-group
|
||||
label.col-sm-3.control-label(for='confirmPassword') Confirm Password
|
||||
.col-sm-4
|
||||
input.form-control(type='password', name='confirmPassword', id='confirmPassword')
|
||||
.form-group
|
||||
.col-sm-offset-3.col-sm-4
|
||||
button.btn.btn.btn-primary(type='submit')
|
||||
i.fa.fa-keyboard-o
|
||||
| Change Password
|
||||
form.form-horizontal(action='/account/password', method='POST')
|
||||
input(type='hidden', name='_csrf', value=_csrf)
|
||||
.form-group
|
||||
label.col-sm-3.control-label(for='password') New Password
|
||||
.col-sm-4
|
||||
input.form-control(type='password', name='password', id='password')
|
||||
.form-group
|
||||
label.col-sm-3.control-label(for='confirmPassword') Confirm Password
|
||||
.col-sm-4
|
||||
input.form-control(type='password', name='confirmPassword', id='confirmPassword')
|
||||
.form-group
|
||||
.col-sm-offset-3.col-sm-4
|
||||
button.btn.btn.btn-primary(type='submit')
|
||||
i.fa.fa-keyboard-o
|
||||
| Change Password
|
||||
|
||||
.page-header
|
||||
h3 Delete Account
|
||||
@ -75,32 +73,27 @@ block content
|
||||
.page-header
|
||||
h3 Linked Accounts
|
||||
|
||||
if secrets.googleAuth
|
||||
if user.google
|
||||
p: a.text-danger(href='/account/unlink/google') Unlink your Google account
|
||||
else
|
||||
p: a(href='/auth/google') Link your Google account
|
||||
if user.google
|
||||
p: a.text-danger(href='/account/unlink/google') Unlink your Google account
|
||||
else
|
||||
p: a(href='/auth/google') Link your Google account
|
||||
|
||||
if secrets.facebookAuth
|
||||
if user.facebook
|
||||
p: a.text-danger(href='/account/unlink/facebook') Unlink your Facebook account
|
||||
else
|
||||
p: a(href='/auth/facebook') Link your Facebook account
|
||||
if user.facebook
|
||||
p: a.text-danger(href='/account/unlink/facebook') Unlink your Facebook account
|
||||
else
|
||||
p: a(href='/auth/facebook') Link your Facebook account
|
||||
|
||||
if secrets.twitterAuth
|
||||
if user.twitter
|
||||
p: a.text-danger(href='/account/unlink/twitter') Unlink your Twitter account
|
||||
else
|
||||
p: a(href='/auth/twitter') Link your Twitter account
|
||||
if user.twitter
|
||||
p: a.text-danger(href='/account/unlink/twitter') Unlink your Twitter account
|
||||
else
|
||||
p: a(href='/auth/twitter') Link your Twitter account
|
||||
|
||||
if secrets.githubAuth
|
||||
if user.github
|
||||
p: a.text-danger(href='/account/unlink/github') Unlink your GitHub account
|
||||
else
|
||||
p: a(href='/auth/github') Link your GitHub account
|
||||
if user.github
|
||||
p: a.text-danger(href='/account/unlink/github') Unlink your GitHub account
|
||||
else
|
||||
p: a(href='/auth/github') Link your GitHub account
|
||||
|
||||
if secrets.linkedinAuth
|
||||
if user.linkedin
|
||||
p: a.text-danger(href='/account/unlink/linkedin') Unlink your LinkedIn account
|
||||
else
|
||||
p: a(href='/auth/linkedin') Link your LinkedIn account
|
||||
if user.linkedin
|
||||
p: a.text-danger(href='/account/unlink/linkedin') Unlink your LinkedIn account
|
||||
else
|
||||
p: a(href='/auth/linkedin') Link your LinkedIn account
|
Reference in New Issue
Block a user