Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Σταύρος Παπαδάκης
e-epal
Commits
97faf4ad
Commit
97faf4ad
authored
May 08, 2017
by
Χάρης Παπαδόπουλος
Browse files
Merge branch 'front_end_review' into 'develop'
logout session issues See merge request !74
parents
6e336d1a
843dead1
Changes
3
Hide whitespace changes
Inline
Side-by-side
drupal/modules/casost/src/Controller/CASLogout.php
View file @
97faf4ad
...
...
@@ -120,7 +120,7 @@ class CASLogout extends ControllerBase
return
$response
;
}
phpCAS
::
handleLogoutRequests
();
//
phpCAS::handleLogoutRequests();
// phpCAS::logoutWithRedirectService('http://eduslim2.minedu.gov.gr/dist/#/school');
// session_unset();
...
...
@@ -136,10 +136,13 @@ class CASLogout extends ControllerBase
// phpCAS::logout();
session_unset
();
session_destroy
();
$this
->
logger
->
warning
(
"hello from logout"
);
\
Drupal
::
service
(
'page_cache_kill_switch'
)
->
trigger
();
return
new
RedirectResponseWithCookieExt
(
"https://sso-test.sch.gr/logout"
,
302
,
[]);
// return $response;
// phpCAS::logoutWithRedirectServiceAndUrl('https://sso-test.sch.gr/logout','');
// header('Location: '.'https://sso-test.sch.gr/login?service=https%3A%2F%2Feduslim2.minedu.gov.gr%2Fdrupal%2Fcas%2Flogin%3Fconfig%3D2');
// header('Location: https://sso-test.sch.gr/logout');
// exit(0);
// return new RedirectResponseWithCookieExt("https://sso-test.sch.gr/logout", 302, []);
return
$response
;
}
catch
(
\
Exception
$e
)
{
$this
->
logger
->
warning
(
$e
->
getMessage
());
$response
=
new
Response
();
...
...
drupal/modules/oauthost/src/Controller/OAuthLogout.php
View file @
97faf4ad
...
...
@@ -134,6 +134,9 @@ class OAuthLogout extends ControllerBase
$response
->
headers
->
set
(
'Content-Type'
,
'application/json'
);
return
$response
;
}
session_unset
();
session_destroy
();
\
Drupal
::
service
(
'page_cache_kill_switch'
)
->
trigger
();
$response
=
new
Response
();
$response
->
setContent
(
'logout successful'
);
$response
->
setStatusCode
(
Response
::
HTTP_OK
);
...
...
source/services/helper-data-service.ts
View file @
97faf4ad
...
...
@@ -13,6 +13,8 @@ import { IAppState } from '../store/store';
import
{
ILoginInfo
,
ILoginInfoToken
}
from
'
../store/logininfo/logininfo.types
'
;
import
{
LOGININFO_INITIAL_STATE
}
from
'
../store/logininfo/logininfo.initial-state
'
;
import
{
SCHOOL_ROLE
,
STUDENT_ROLE
,
PDE_ROLE
,
DIDE_ROLE
,
MINISTRY_ROLE
}
from
'
../constants
'
;
import
{
CookieService
}
from
'
ngx-cookie
'
;
const
HEADER
=
{
headers
:
new
Headers
({
'
Content-Type
'
:
'
application/json
'
})
};
...
...
@@ -27,9 +29,11 @@ export class HelperDataService implements OnInit, OnDestroy {
constructor
(
private
http
:
Http
,
private
_ngRedux
:
NgRedux
<
IAppState
>
)
{
private
_ngRedux
:
NgRedux
<
IAppState
>
,
private
_cookieService
:
CookieService
)
{
this
.
loginInfo$
=
new
BehaviorSubject
(
LOGININFO_INITIAL_STATE
);
};
ngOnInit
()
{
...
...
@@ -421,14 +425,8 @@ export class HelperDataService implements OnInit, OnDestroy {
});
let
headers
=
new
Headers
({
//"Authorization": "Basic cmVzdHVzZXI6czNjckV0MFAwdWwwJA==", // encoded user:pass
"
Content-Type
"
:
"
application/json
"
,
// "Accept": "*/*",
// "Access-Control-Allow-Credentials": "true",
// "Access-Control-Allow-Origin": "*",
//"X-CSRF-Token": "EoAZ0APpIbbewK5MNzRrCFkvEeZZoGQsBslWFTrZ8bI",
// "X-oauth-enabled": "true",
// "X-Auth-Token": this.authToken
});
if
(
this
.
authRole
===
MINISTRY_ROLE
)
...
...
@@ -437,8 +435,23 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
createAuthorizationHeader
(
headers
);
let
options
=
new
RequestOptions
({
headers
:
headers
,
withCredentials
:
true
});
let
logoutRoute
=
'
/oauth/logout
'
;
if
(
this
.
authRole
===
SCHOOL_ROLE
||
this
.
authRole
===
PDE_ROLE
||
this
.
authRole
===
DIDE_ROLE
)
if
(
this
.
authRole
===
SCHOOL_ROLE
||
this
.
authRole
===
PDE_ROLE
||
this
.
authRole
===
DIDE_ROLE
)
{
logoutRoute
=
'
/cas/logout
'
;
return
new
Promise
((
resolve
,
reject
)
=>
{
this
.
http
.
get
(
`
${
AppSettings
.
API_ENDPOINT
}${
logoutRoute
}${
AppSettings
.
API_ENDPOINT_PARAMS
}
`
,
options
)
.
map
(
response
=>
response
)
.
subscribe
(
data
=>
{
this
.
_cookieService
.
removeAll
();
resolve
(
data
);
},
// put the data returned from the server in our variable
error
=>
{
console
.
log
(
"
Error Logout
"
);
// in case of failure show this message
reject
(
"
Error Logout
"
);
},
()
=>
console
.
log
(
"
Logging out
"
));
//run this code in all cases); */
});
}
else
if
(
this
.
authRole
===
MINISTRY_ROLE
)
logoutRoute
=
'
/ministry/logout
'
;
...
...
@@ -446,6 +459,7 @@ export class HelperDataService implements OnInit, OnDestroy {
this
.
http
.
post
(
`
${
AppSettings
.
API_ENDPOINT
}${
logoutRoute
}${
AppSettings
.
API_ENDPOINT_PARAMS
}
`
,
{},
options
)
.
map
(
response
=>
response
)
.
subscribe
(
data
=>
{
this
.
_cookieService
.
removeAll
();
resolve
(
data
);
},
// put the data returned from the server in our variable
error
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment