Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
o365-3420422
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
o365-3420422
Commits
09e86b72
Commit
09e86b72
authored
2 years ago
by
Fabian de Rijk
Browse files
Options
Downloads
Patches
Plain Diff
Removed cookie auth
parent
8d6da5ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/AuthenticationService.php
+0
-27
0 additions, 27 deletions
src/AuthenticationService.php
src/AuthenticationServiceInterface.php
+0
-7
0 additions, 7 deletions
src/AuthenticationServiceInterface.php
src/ConstantsService.php
+0
-10
0 additions, 10 deletions
src/ConstantsService.php
with
0 additions
and
44 deletions
src/AuthenticationService.php
+
0
−
27
View file @
09e86b72
...
...
@@ -94,13 +94,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
*/
private
$authValues
=
[];
/**
* If we want to save the auth as a cookie.
*
* @var bool
*/
public
$useCookieAuth
=
FALSE
;
/**
* The current user account.
*
...
...
@@ -252,20 +245,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
return
FALSE
;
}
/**
* {@inheritdoc}
*/
public
function
saveAuthDataFromCookie
()
{
$authCookie
=
$_COOKIE
[
$this
->
constants
->
getUserTempStoreDataName
()];
$authValues
=
json_decode
(
$authCookie
,
TRUE
);
// Save the data and delete the cookie.
$this
->
saveDataToTempStore
(
$this
->
constants
->
getUserTempStoreDataName
(),
$authValues
);
setcookie
(
$this
->
constants
->
getUserTempStoreDataName
(),
''
,
time
()
-
3600
);
$this
->
useCookieAuth
=
FALSE
;
}
/**
* {@inheritdoc}
*/
...
...
@@ -342,11 +321,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
* The saved auth data.
*/
private
function
getAuthData
()
{
if
(
$this
->
useCookieAuth
)
{
$authCookie
=
$_COOKIE
[
$this
->
constants
->
getUserTempStoreDataName
()];
return
json_decode
(
$authCookie
,
TRUE
);
}
// Check if there is some auth data on the url, if so, save it.
if
(
!
empty
(
$this
->
request
->
get
(
'access_token'
)))
{
$this
->
saveAuthDataFromUrl
();
...
...
@@ -377,7 +351,6 @@ class AuthenticationService implements AuthenticationServiceInterface {
}
$this
->
saveDataToTempStore
(
$this
->
constants
->
getUserTempStoreDataName
(),
$this
->
authValues
);
setcookie
(
$this
->
constants
->
getUserTempStoreDataName
(),
json_encode
(
$this
->
authValues
),
$this
->
constants
->
getCookieExpire
(),
'/'
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
src/AuthenticationServiceInterface.php
+
0
−
7
View file @
09e86b72
...
...
@@ -51,13 +51,6 @@ interface AuthenticationServiceInterface {
*/
public
function
getAccessToken
(
$login
=
FALSE
);
/**
* Save the auth data from the cookie in the user session storage.
*
* @throws \Drupal\Core\TempStore\TempStoreException
*/
public
function
saveAuthDataFromCookie
();
/**
* Save the auth data from the url parameters in the user session storage.
*
...
...
This diff is collapsed.
Click to expand it.
src/ConstantsService.php
+
0
−
10
View file @
09e86b72
...
...
@@ -156,16 +156,6 @@ class ConstantsService {
return
$this
->
userTempStoreDataName
;
}
/**
* Get the cookie expire timestamp.
*
* @return int
* The expire timestamp.
*/
public
function
getCookieExpire
()
{
return
time
()
+
3600
;
}
/**
* Get the tenant ID.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment