Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
mathieu
potage
Commits
34869394
Commit
34869394
authored
Aug 31, 2018
by
Mat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Le token est d'abord décodé par le service lettreToken
parent
50957a7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
src/PotageBundle/Resources/views/Mail/bodyMail.html.twig
src/PotageBundle/Resources/views/Mail/bodyMail.html.twig
+0
-3
src/PotageBundle/Security/TokenAuthenticator.php
src/PotageBundle/Security/TokenAuthenticator.php
+18
-1
No files found.
src/PotageBundle/Resources/views/Mail/bodyMail.html.twig
View file @
34869394
...
...
@@ -32,9 +32,6 @@
<p>
{{
body.groupe.nom
}}
<br>
{{
body.depot.localisation
}}
</p>
{%
for
i
in
body.lettre.sorted
%}
{{
i
}}
{%
endfor
%}
{{
dump
()
}}
...
...
src/PotageBundle/Security/TokenAuthenticator.php
View file @
34869394
...
...
@@ -3,6 +3,7 @@
namespace
PotageBundle\Security
;
use
PotageBundle\Services\LettreToken
;
use
Symfony\Component\HttpFoundation\JsonResponse
;
use
Symfony\Component\HttpFoundation\Request
;
use
Symfony\Component\HttpFoundation\Response
;
...
...
@@ -15,6 +16,19 @@ use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
class
TokenAuthenticator
extends
AbstractGuardAuthenticator
{
private
$lettreToken
;
/**
* TokenAuthenticator constructor.
*
* @param LettreToken $lettreToken
*/
public
function
__construct
(
LettreToken
$lettreToken
)
{
$this
->
lettreToken
=
$lettreToken
;
}
/**
* Called on every request to decide if this authenticator should be
* used for the request. Returning false will cause this authenticator
...
...
@@ -81,8 +95,11 @@ class TokenAuthenticator extends AbstractGuardAuthenticator
*/
public
function
getCredentials
(
Request
$request
)
{
$tokenEncoded
=
$request
->
query
->
get
(
'token'
);
$inToken
=
$this
->
lettreToken
->
decodePotageAccess
(
$tokenEncoded
);
return
array
(
'token'
=>
$
request
->
query
->
get
(
'
token'
)
,
'token'
=>
$
inToken
[
'user_
token'
]
,
);
}
...
...
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