diff --git a/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee b/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee index dc6b76911..0c1fbbb7d 100644 --- a/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee +++ b/app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee @@ -11,34 +11,45 @@ class Index extends App.ControllerSubContent render: => auth_provider_all = { facebook: { - key: 'facebook' - url: '/auth/facebook', - name: 'Facebook', - config: 'auth_facebook', + url: '/auth/facebook' + name: 'Facebook' + config: 'auth_facebook' }, twitter: { - key: 'twitter' - url: '/auth/twitter', - name: 'Twitter', - config: 'auth_twitter', + url: '/auth/twitter' + name: 'Twitter' + config: 'auth_twitter' }, linkedin: { - key: 'linkedin' - url: '/auth/linkedin', - name: 'LinkedIn', - config: 'auth_linkedin', + url: '/auth/linkedin' + name: 'LinkedIn' + config: 'auth_linkedin' + }, + github: { + url: '/auth/github' + name: 'GitHub' + config: 'auth_github' + }, + gitlab: { + url: '/auth/gitlab' + name: 'GitLab' + config: 'auth_gitlab' }, google_oauth2: { - key: 'google_oauth2' - url: '/auth/google_oauth2', - name: 'Google', - config: 'auth_google_oauth2', + url: '/auth/google_oauth2' + name: 'Google' + config: 'auth_google_oauth2' + }, + oauth2: { + url: '/auth/oauth2' + name: 'OAuth2' + config: 'auth_oauth2' }, } - auth_providers = [] + auth_providers = {} for key, provider of auth_provider_all if @Config.get(provider.config) is true || @Config.get(provider.config) is 'true' - auth_providers.push provider + auth_providers[key] = provider @html App.view('profile/linked_accounts')( user: App.Session.get() @@ -54,7 +65,7 @@ class Index extends App.ControllerSubContent @ajax( id: 'account' type: 'DELETE' - url: @apiPath + '/users/account' + url: "#{@apiPath}/users/account" data: JSON.stringify(provider: provider, uid: uid) processData: true success: @success diff --git a/app/assets/javascripts/app/controllers/login.coffee b/app/assets/javascripts/app/controllers/login.coffee index ed3c580a8..f3111bd88 100644 --- a/app/assets/javascripts/app/controllers/login.coffee +++ b/app/assets/javascripts/app/controllers/login.coffee @@ -40,9 +40,9 @@ class Index extends App.ControllerContent render: (data = {}) -> auth_provider_all = { facebook: { - url: '/auth/facebook' - name: 'Facebook' - config: 'auth_facebook' + url: '/auth/facebook', + name: 'Facebook', + config: 'auth_facebook', class: 'facebook' }, twitter: { @@ -59,13 +59,13 @@ class Index extends App.ControllerContent }, github: { url: '/auth/github' - name: 'Github' + name: 'GitHub' config: 'auth_github' class: 'github' }, gitlab: { url: '/auth/gitlab' - name: 'Gitlab' + name: 'GitLab' config: 'auth_gitlab' class: 'gitlab' }, @@ -75,6 +75,12 @@ class Index extends App.ControllerContent config: 'auth_google_oauth2' class: 'google' }, + oauth2: { + url: '/auth/oauth2' + name: 'OAuth2' + config: 'auth_oauth2' + class: 'oauth2' + }, } auth_providers = [] for key, provider of auth_provider_all diff --git a/app/assets/javascripts/app/views/profile/linked_accounts.jst.eco b/app/assets/javascripts/app/views/profile/linked_accounts.jst.eco index a056a8c9c..4f184ad97 100644 --- a/app/assets/javascripts/app/views/profile/linked_accounts.jst.eco +++ b/app/assets/javascripts/app/views/profile/linked_accounts.jst.eco @@ -5,10 +5,12 @@