Skip to content

Commit

Permalink
Merge pull request #100 from PlaidWeb/feature/96-release-deps
Browse files Browse the repository at this point in the history
Relax dependencies
  • Loading branch information
fluffy-critter committed Aug 31, 2021
2 parents c3d4b26 + b433897 commit bf40303
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 77 deletions.
6 changes: 3 additions & 3 deletions authl/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ def __init__(self,
stylesheet: typing.Union[str, typing.Callable] = None,
on_verified: typing.Callable = None,
make_permanent: bool = True,
state_storage: dict = None,
state_storage: typing.Dict = None,
token_storage: tokens.TokenStore = None,
session_namespace='_authl',
):
# pylint:disable=too-many-arguments,too-many-locals,too-many-statements

if state_storage is None:
state_storage = flask.session
state_storage = typing.cast(typing.Dict, flask.session)

self.authl = from_config(
config,
Expand Down Expand Up @@ -316,7 +316,7 @@ def _handle_disposition(self, disp: disposition.Disposition):

LOGGER.info("Successful login: %s", disp.identity)
if self._session_auth_name is not None:
flask.session.permanent = self.make_permanent
flask.session.permanent = self.make_permanent # pylint:disable=assigning-non-slot
flask.session[self._session_auth_name] = disp.identity

if self._on_verified:
Expand Down
5 changes: 3 additions & 2 deletions authl/handlers/email_addr.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ def from_config(config, token_store: tokens.TokenStore):
data. Defaults to a simple string-based message.
* ``EMAIL_TEMPLATE_FILE``: A path to a text file for the email message; if
not specified a default template will be used.
not specified a default template will be used. This file must use an
UTF-8 encoding.
* ``EMAIL_EXPIRE_TIME``: How long a login email is valid for, in seconds
(defaults to the :py:class:`EmailAddress` default value)
Expand All @@ -290,7 +291,7 @@ def from_config(config, token_store: tokens.TokenStore):
check_message = config.get('EMAIL_CHECK_MESSAGE', 'Check your email for a login link')

if 'EMAIL_TEMPLATE_FILE' in config:
with open(config['EMAIL_TEMPLATE_FILE']) as file:
with open(config['EMAIL_TEMPLATE_FILE'], encoding='utf-8') as file:
email_template_text = file.read()
else:
email_template_text = DEFAULT_TEMPLATE_TEXT
Expand Down

0 comments on commit bf40303

Please sign in to comment.