bugfix hwioauth remember me && centralize hwioauth and facebook settings
This commit is contained in:
@@ -9,9 +9,12 @@ hwi_oauth_login:
|
||||
|
||||
facebook_login:
|
||||
path: /login/check-facebook
|
||||
defaults: { _remember_me: on }
|
||||
|
||||
google_login:
|
||||
path: /login/check-google
|
||||
defaults: { _remember_me: on }
|
||||
|
||||
github_login:
|
||||
path: /login/check-github
|
||||
defaults: { _remember_me: on }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
services:
|
||||
my.custom.user_provider:
|
||||
jotun.user_provider:
|
||||
class: Jotunheimr\UserBundle\Security\Core\User\MyFOSUBUserProvider
|
||||
arguments: ['@fos_user.user_manager', { facebook: facebookId }, '@doctrine.orm.entity_manager']
|
||||
|
||||
@@ -40,23 +40,17 @@
|
||||
$(document).snowfall({deviceorientation: true, round: true, minSize: 5, maxSize: 8});
|
||||
|
||||
$('#fbLogin').length && $('#fbLogin').on('click', function () {
|
||||
FB.login(function (response) {
|
||||
if (response.authResponse) {
|
||||
FB.getLoginStatus(function (response) {
|
||||
if (response.status === 'connected') {
|
||||
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
|
||||
} else {
|
||||
FB.login(function (response) {
|
||||
if (response.authResponse) {
|
||||
document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";
|
||||
}
|
||||
}, {scope: '{{ facebook_scope }}'});
|
||||
}
|
||||
}, {scope: 'email'});
|
||||
|
||||
{#FB.getLoginStatus(function (response) {#}
|
||||
{#if (response.status === 'connected') {#}
|
||||
{#document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";#}
|
||||
{#} else {#}
|
||||
{#FB.login(function (response) {#}
|
||||
{#if (response.authResponse) {#}
|
||||
{#document.location = "{{ url("hwi_oauth_service_redirect", {service: "facebook"}) }}";#}
|
||||
{#}#}
|
||||
{#}, {scope: 'email'});#}
|
||||
{#}#}
|
||||
{#});#}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user