@app.route('/authorized')
def authorized_view():
 session_auth_state = session.get('authstate')
 auth_code = request.args.get('code')
 auth_state = request.args.get('state')
 if (session_auth_state != auth_state):
  abort(401)
 redirect_uri = session.get('redirecturiafterauthorized')
 auth.clear_session_token()
 token_response = auth.get_tokens(auth_code)
 auth.set_session_token_response(token_response)
 if (not redirect_uri):
  redirect_uri = url_for('home_view')
 return redirect(redirect_uri)

@ app . route ( '/authorized' ) def authorized_view ( ) : session_auth_state = session . get ( 'authstate' ) auth_code = request . args . get ( 'code' ) auth_state = request . args . get ( 'state' ) if ( session_auth_state != auth_state ) : abort ( 401 ) redirect_uri = session . get ( 'redirecturiafterauthorized' ) auth . clear_session_token ( ) token_response = auth . get_tokens ( auth_code ) auth . set_session_token_response ( token_response ) if ( not redirect_uri ) : redirect_uri = url_for ( 'home_view' ) return redirect ( redirect_uri )
renders the post azure authorization page .