(tid=None)
return render_template('tokens.html')
Allows the user to view their OAuth tokens stored with Notifico.
Allows the user to view their OAuth tokens stored with Notifico.
Allows the user to view their OAuth tokens stored with Notifico .
def tokens(tid=None):
    """
    Allows the user to view their OAuth tokens stored with Notifico.
    """
    if tid is not None:
        t = AuthToken.query.get(tid)
        if t is None:
            # The token no longer exists.
            return abort(404)

        if t.owner.id != g.user.id:
            # Forbidden, you don't own this token.
            return abort(403)

        t.owner.tokens.remove(t)
        db.session.delete(t)
        db.session.commit()

        return redirect(url_for('.tokens'))

    return render_template('tokens.html')
def tokens ( tid = None ) : if tid is not None : t = AuthToken . query . get ( tid ) if t is None : # The token no longer exists. return abort ( 404 ) if t . owner . id != g . user . id : # Forbidden, you don't own this token. return abort ( 403 ) t . owner . tokens . remove ( t ) db . session . delete ( t ) db . session . commit ( ) return redirect ( url_for ( '.tokens' ) ) return render_template ( 'tokens.html' )