diff --git a/flask_discord/client.py b/flask_discord/client.py index d8279d7..125481b 100644 --- a/flask_discord/client.py +++ b/flask_discord/client.py @@ -61,13 +61,18 @@ class DiscordOAuth2Session(_http.DiscordOAuth2HttpClient): def revoke(self): """This method clears current discord token, state and all session data from flask - session . Which means user will have + `session `_. Which means user will have to go through discord authorization token grant flow again. """ for session_key in self.SESSION_KEYS: session.pop(session_key) + @property + def authorized(self): + """A boolean indicating whether current session has authorization token or not.""" + return self._make_session().authorized + def fetch_user(self): return models.User(self.get("/users/@me"))