fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add a filter
[wolnelektury.git]
/
src
/
api
/
drf_auth.py
diff --git
a/src/api/drf_auth.py
b/src/api/drf_auth.py
index
adee780
..
813d929
100644
(file)
--- a/
src/api/drf_auth.py
+++ b/
src/api/drf_auth.py
@@
-2,9
+2,10
@@
# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from oauthlib.oauth1 import ResourceEndpoint
# Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
#
from oauthlib.oauth1 import ResourceEndpoint
-from rest_framework.authentication import BaseAuthentication
+from rest_framework.authentication import BaseAuthentication
, TokenAuthentication
from .request_validator import PistonRequestValidator
from .utils import oauthlib_request
from .request_validator import PistonRequestValidator
from .utils import oauthlib_request
+from .models import Token
class PistonOAuthAuthentication(BaseAuthentication):
class PistonOAuthAuthentication(BaseAuthentication):
@@
-21,3
+22,7
@@
class PistonOAuthAuthentication(BaseAuthentication):
)
if v:
return r.token.user, r.token
)
if v:
return r.token.user, r.token
+
+
+class WLTokenAuthentication(TokenAuthentication):
+ model = Token