Compare commits
No commits in common. "0dfdf70c45d907c12f94422b18fe4f036baf97e0" and "9d0d0b2686a78a7d3f13aefc7dd00e5f97c287bb" have entirely different histories.
0dfdf70c45
...
9d0d0b2686
@ -343,7 +343,7 @@ to ask the user for the username and password again.
|
|||||||
|
|
||||||
|
|
||||||
Log In Bookkeeping
|
Log In Bookkeeping
|
||||||
==================
|
=================#
|
||||||
|
|
||||||
You can register a callback to run when the user logs in, for ex.,
|
You can register a callback to run when the user logs in, for ex.,
|
||||||
logging the log in event, adding the log in counter, etc.
|
logging the log in event, adding the log in counter, etc.
|
||||||
@ -402,7 +402,6 @@ Copyright
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ class DigestAuth:
|
|||||||
class NoLogInException(Exception):
|
class NoLogInException(Exception):
|
||||||
"""The exception thrown when the user is not authorized."""
|
"""The exception thrown when the user is not authorized."""
|
||||||
|
|
||||||
def get_logged_in_user() -> t.Any:
|
def get_logged_in_user() -> t.Optional[t.Any]:
|
||||||
"""Returns the currently logged-in user.
|
"""Returns the currently logged-in user.
|
||||||
|
|
||||||
:return: The currently logged-in user.
|
:return: The currently logged-in user.
|
||||||
@ -120,7 +120,6 @@ class DigestAuth:
|
|||||||
raise NoLogInException
|
raise NoLogInException
|
||||||
user: t.Optional[t.Any] = self.__get_user(session["user"])
|
user: t.Optional[t.Any] = self.__get_user(session["user"])
|
||||||
if user is None:
|
if user is None:
|
||||||
del session["user"]
|
|
||||||
raise NoLogInException
|
raise NoLogInException
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user