def get_token(): return jsonify(token=current_user.generate_token())
def new_key(): if not current_user.is_authenticated(): return flask.abort(404) current_user.api_token = current_user.generate_token() db.session.commit() return flask.redirect(flask.url_for(".index"))
def new_key(): if not current_user.is_authenticated(): return flask.abort(404) current_user.api_token = current_user.generate_token() db.session.commit() return flask.redirect(flask.url_for(".index"))
def resend_confirmation(): token = current_user.generate_token() send_mail(current_user.email, 'Confirm your Accout.', 'auth/email/confirm', user=current_user, token=token) flash('A new confirmation email has been sent to you.') return redirect(url_for('main.index'))