Skip to content

Commit

Permalink
#241 Remove facebook soccialapp (#306)
Browse files Browse the repository at this point in the history
* #241 Remove facebook soccialapp

* #241 Remove facebook soccialapp from main.yml
  • Loading branch information
viliambalaz authored Sep 30, 2020
1 parent e7b499f commit efe166e
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 53 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ jobs:
"y"
# Admin password
"admin"
# Facebook OAuth Client ID (default)
""
# Facebook OAuth Secret (default)
""
# Google OAuth Client ID (default)
""
# Google OAuth Secret (default)
Expand Down
20 changes: 0 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,26 +308,6 @@ your browser.
'Client secret'.


### 3.2. Facebook OAuth

1. Go to https://developers.facebook.com/apps/ and create an app.

2. Add a Product 'Facebook Login' and select platform 'Web'. Enter 'Site URL' `https://{domain}/`.

3. Go to 'Facebook Login' / 'Settings' and add 'Valid OAuth Redirect URIs':

https://{domain}/accounts/facebook/login/callback/
https://{domain}/sk/accounts/facebook/login/callback/
https://{domain}/en/accounts/facebook/login/callback/

Where `{domain}` is your production domain or `127.0.0.1:8000` if in local development mode.
'Site URL' in form `127.0.0.1:8000` is invalid use `localhost:8000` instead.

5. Run the configuration script `setup.py` and enter given 'App ID' and 'App Secret'.

To use Facebook Login on localhost, you need to use [https connection](#15-viewing-the-site-using-https).


## 4. Google custom search engine key

1. Sign into [Control Panel](https://cse.google.com/create/new) using your Google Account.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


SITE_ID = 1

def forward(apps, schema_editor):
SocialApp = apps.get_model(u'socialaccount', u'SocialApp')
SocialAccount = apps.get_model(u'socialaccount', u'SocialAccount')
SocialApp.objects.filter(provider=u'facebook').delete()
SocialAccount.objects.filter(provider=u'facebook').delete()

def backward(apps, schema_editor):
SocialApp = apps.get_model(u'socialaccount', u'SocialApp')
facebook = SocialApp.objects.create(provider=u'facebook', name=u'Facebook OAuth')
facebook.sites.add(SITE_ID)

class Migration(migrations.Migration):

dependencies = [
('accounts', '0005_socialapp_remove_twitter_and_linkedin'),
('socialaccount', '0001_initial'),
]

operations = [
migrations.RunPython(forward, backward),
]
3 changes: 0 additions & 3 deletions chcemvediet/locale/sk/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1317,9 +1317,6 @@ msgstr "Registrácia pozastavená"
msgid "account:signup_closed:text"
msgstr "Ospravedlňujeme sa, registrácia je momentálne pozastavená."

msgid "account:social_buttons:facebook"
msgstr "Prihlásiť pomocou Facebooku"

msgid "account:social_buttons:google"
msgstr "Prihlásiť pomocou Googlu"

Expand Down
1 change: 0 additions & 1 deletion chcemvediet/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
u'allauth',
u'allauth.account',
u'allauth.socialaccount',
u'allauth.socialaccount.providers.facebook',
u'allauth.socialaccount.providers.google',
# Other 3part apps
u'adminplus',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@


<div class="chv-social-login-buttons">
<a href="{% provider_login_url "facebook" process=process %}"
title="{% trans 'account:social_buttons:facebook' %}">
<span class="chv-icon-stack chv-icon-3x">
<i class="chv-icon icon-circle chv-color-facebook"></i>
<i class="chv-icon chv-icon-half chv-icon-inv icon-facebook"></i>
</span>
</a>
<a href="{% provider_login_url "google" process=process %}"
title="{% trans 'account:social_buttons:google' %}">
<span class="chv-icon-stack chv-icon-3x">
Expand Down
14 changes: 0 additions & 14 deletions fixtures/socialaccount_socialapp.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
[
{
"pk": 1,
"model": "socialaccount.socialapp",
"fields": {
"name": "Facebook OAuth",
"sites": [
1
],
"secret": "(insert Client Secret here)",
"client_id": "(insert Client ID here)",
"key": "",
"provider": "facebook"
}
},
{
"pk": 2,
"model": "socialaccount.socialapp",
Expand Down
4 changes: 0 additions & 4 deletions misc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ RUN \
"y" \
# Admin password
"nbusr123" \
# Facebook OAuth Client ID (default)
"" \
# Facebook OAuth Secret (default)
"" \
# Google OAuth Client ID (default)
"" \
# Google OAuth Secret (default)
Expand Down

0 comments on commit efe166e

Please sign in to comment.