def new_password(user_id: int) -> werkzeug.Response: try: user = Journalist.query.get(user_id) except NoResultFound: abort(404) password = request.form.get('password') if set_diceware_password(user, password) is not False: if user.last_token is not None: revoke_token(user, user.last_token) user.session_nonce += 1 db.session.commit() return redirect(url_for('admin.edit_user', user_id=user_id))
def logout() -> Tuple[flask.Response, int]: user = _authenticate_user_from_auth_header(request) auth_token = request.headers['Authorization'].split(" ")[1] utils.revoke_token(user, auth_token) return jsonify({'message': 'Your token has been revoked.'}), 200
def logout(): user = get_user_object(request) auth_token = request.headers.get('Authorization').split(" ")[1] utils.revoke_token(user, auth_token) return jsonify({'message': 'Your token has been revoked.'}), 200