Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom oauth #642

Merged
merged 12 commits into from
Aug 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,5 @@ raix:push@2.6.13-rc.1
jalik:ufs
jalik:ufs-gridfs
monbro:mongodb-mapreduce-aggregation
accounts-gitlab
gitlab
rocketchat:custom-oauth
rocketchat:gitlab
3 changes: 1 addition & 2 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
accounts-base@1.2.0
accounts-facebook@1.0.4
accounts-github@1.0.4
accounts-gitlab@1.0.5-plugins.0
accounts-google@1.0.4
accounts-meteor-developer@1.0.4
accounts-oauth@1.1.5
Expand Down Expand Up @@ -32,7 +31,6 @@ fastclick@1.0.3
francocatena:status@1.3.2
geojson-utils@1.0.3
github@1.1.3
gitlab@1.1.4-plugins.0
google@1.1.5
html-tools@1.0.4
htmljs@1.0.4
Expand Down Expand Up @@ -104,6 +102,7 @@ reload@1.1.3
retry@1.0.3
rocketchat:autolinker@0.0.1
rocketchat:colors@0.0.1
rocketchat:custom-oauth@1.0.0
rocketchat:emojione@0.0.1
rocketchat:favico@0.0.1
rocketchat:file@0.0.1
Expand Down
3 changes: 0 additions & 3 deletions client/stylesheets/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -3546,9 +3546,6 @@ a.github-fork {
padding: 0;
-webkit-flex-grow: 1;
flex-grow: 1;
span {
display: none;
}
}
}

Expand Down
23 changes: 14 additions & 9 deletions client/views/login/services.coffee
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
Meteor.startup ->
ServiceConfiguration.configurations.find({custom: true}).observe
added: (record) ->
new CustomOAuth record.service,
serverURL: record.serverURL

Template.loginServices.helpers
loginService: ->
services = []

authServices = _.pluck ServiceConfiguration.configurations.find({}, { service: 1 }).fetch(), 'service'
authServices = ServiceConfiguration.configurations.find({}, { sort: {service: 1} }).fetch()

authServices.sort()
authServices.forEach (service) ->
switch service
switch service.service
when 'meteor-developer'
serviceName = 'Meteor'
icon = 'meteor'
Expand All @@ -15,10 +20,10 @@ Template.loginServices.helpers
icon = 'github-circled'
when 'gitlab'
serviceName = 'Gitlab'
icon = service
icon = service.service
else
serviceName = _.capitalize service
icon = service
serviceName = _.capitalize service.service
icon = service.service

services.push
service: service
Expand All @@ -29,7 +34,7 @@ Template.loginServices.helpers

Template.loginServices.events
'click .external-login': (e, t)->
return unless this.service?
return unless this.service?.service?

loadingIcon = $(e.currentTarget).find('.loading-icon')
serviceIcon = $(e.currentTarget).find('.service-icon')
Expand All @@ -38,7 +43,7 @@ Template.loginServices.events
serviceIcon.addClass 'hidden'

# login with native facebook app
if Meteor.isCordova and this.service is 'facebook'
if Meteor.isCordova and this.service.service is 'facebook'
Meteor.loginWithFacebookCordova {}, (error) ->
loadingIcon.addClass 'hidden'
serviceIcon.removeClass 'hidden'
Expand All @@ -50,7 +55,7 @@ Template.loginServices.events

FlowRouter.go 'index'
else
loginWithService = "loginWith" + (if this.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service))
loginWithService = "loginWith" + (if this.service.service is 'meteor-developer' then 'MeteorDeveloperAccount' else _.capitalize(this.service.service))
serviceConfig = {}
Meteor[loginWithService] serviceConfig, (error) ->
loadingIcon.addClass 'hidden'
Expand Down
2 changes: 1 addition & 1 deletion client/views/login/services.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{#if loginService.length}}
<div class="social-login">
{{#each loginService}}
<button type="button" class="button external-login {{service}}"><i class="icon-{{icon}} service-icon"></i><i class="icon-spin4 animate-spin loading-icon hidden"></i><span>{{displayName}}</span></button>
<button type="button" class="button external-login {{service.service}}" title="{{displayName}}" style="{{#if service.buttonColor}}background-color:{{service.buttonColor}};{{/if}}{{#if service.buttonLabelColor}}color:{{service.buttonLabelColor}};{{/if}}"><i class="icon-{{icon}} service-icon"></i><i class="icon-spin4 animate-spin loading-icon hidden"></i><span>{{service.buttonLabelText}}</span></button>
{{/each}}
</div>
{{/if}}
Expand Down
49 changes: 29 additions & 20 deletions i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,35 @@
"Access_Online_Demo" : "Access the Online Demo",
"Accounts_denyUnverifiedEmail" : "Deny unverified e-mail",
"Accounts_EmailVerification" : "E-mail Verification",
"Accounts_Facebook": "Facebook Login",
"Accounts_Facebook_id": "Facebook App Id",
"Accounts_Facebook_secret": "Facebook Secret",
"Accounts_Github": "GitHub Login",
"Accounts_Github_id": "GitHub Id",
"Accounts_Github_secret": "GitHub Secret",
"Accounts_Google": "Google Login",
"Accounts_Google_id": "Google Id",
"Accounts_Google_secret": "Google Secret",
"Accounts_Linkedin": "LinkedIn Login",
"Accounts_Linkedin_id": "LinkedIn Id",
"Accounts_Linkedin_secret": "LinkedIn Secret",
"Accounts_ManuallyApproveNewUsers" : "Manually aprove new users",
"Accounts_Meteor": "Meteor Login",
"Accounts_Meteor_id": "Meteor Id",
"Accounts_Meteor_secret": "Meteor Secret",
"Accounts_RegistrationRequired" : "Registration Required",
"Accounts_Twitter": "Twitter Login",
"Accounts_Twitter_id": "Twitter Id",
"Accounts_Twitter_secret": "Twitter Secret",
"Accounts_OAuth_Facebook": "Facebook Login",
"Accounts_OAuth_Facebook_id": "Facebook App Id",
"Accounts_OAuth_Facebook_secret": "Facebook Secret",
"Accounts_OAuth_Github": "GitHub Login",
"Accounts_OAuth_Github_id": "GitHub Id",
"Accounts_OAuth_Github_secret": "GitHub Secret",
"Accounts_OAuth_Google": "Google Login",
"Accounts_OAuth_Google_id": "Google Id",
"Accounts_OAuth_Google_secret": "Google Secret",
"Accounts_OAuth_Linkedin": "LinkedIn Login",
"Accounts_OAuth_Linkedin_id": "LinkedIn Id",
"Accounts_OAuth_Linkedin_secret": "LinkedIn Secret",
"Accounts_OAuth_ManuallyApproveNewUsers" : "Manually aprove new users",
"Accounts_OAuth_Meteor": "Meteor Login",
"Accounts_OAuth_Meteor_id": "Meteor Id",
"Accounts_OAuth_Meteor_secret": "Meteor Secret",
"Accounts_OAuth_RegistrationRequired" : "Registration Required",
"Accounts_OAuth_Twitter": "Twitter Login",
"Accounts_OAuth_Twitter_id": "Twitter Id",
"Accounts_OAuth_Twitter_secret": "Twitter Secret",
"Accounts_OAuth_Custom_ID": "ID",
"Accounts_OAuth_Custom_URL": "URL",
"Accounts_OAuth_Custom_Token_Path": "Token Path",
"Accounts_OAuth_Custom_Identity_Path": "Identity Path",
"Accounts_OAuth_Custom_Secret": "Secret",
"Accounts_OAuth_Custom_Enable": "Enable",
"Accounts_OAuth_Custom_Button_Label_Text": "Button Text",
"Accounts_OAuth_Custom_Button_Label_Color": "Button Text Color",
"Accounts_OAuth_Custom_Button_Color": "Button Color",
"Add_Members" : "Add Members",
"Add_users" : "Add users",
"Administration" : "Administration",
Expand Down
3 changes: 0 additions & 3 deletions packages/accounts-gitlab/README.md

This file was deleted.

19 changes: 0 additions & 19 deletions packages/accounts-gitlab/gitlab.js

This file was deleted.

16 changes: 0 additions & 16 deletions packages/accounts-gitlab/package.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/gitlab/.gitignore

This file was deleted.

38 changes: 0 additions & 38 deletions packages/gitlab/gitlab_client.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/gitlab/gitlab_common.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/gitlab/gitlab_configure.html

This file was deleted.

12 changes: 0 additions & 12 deletions packages/gitlab/gitlab_configure.js

This file was deleted.

77 changes: 0 additions & 77 deletions packages/gitlab/gitlab_server.js

This file was deleted.

23 changes: 0 additions & 23 deletions packages/gitlab/package.js

This file was deleted.

File renamed without changes.
Loading