def METHOD_NAME():
    if authed():
        user = Users.query.filter_by(id=session["id"]).first()
        # Check if the session is still valid
        session_hash = session.get("hash")
        if session_hash:
            if session_hash != hmac(user.password):
                logout_user()
                if request.content_type == "application/json":
                    error = 401
                else:
                    error = redirect(url_for("auth.login", next=request.full_path))
                abort(error)
        return user
    else:
        return None