#NEWLINE# @ app . route ( '/signin/' , methods = [ 'GET' , 'POST' ] ) #NEWLINE# def signin( ) : #NEWLINE# #INDENT# next_url = util . get_next_url ( ) #NEWLINE# form = None #NEWLINE# if config . CONFIG_DB . has_email_authentication : #NEWLINE# #INDENT# form = form_with_recaptcha ( SignInForm ( ) ) #NEWLINE# save_request_params ( ) #NEWLINE# if form . validate_on_submit ( ) : #NEWLINE# #INDENT# result = get_user_db_from_email ( form . email . data , result . password . data ) #NEWLINE# if result : #NEWLINE# #INDENT# cache . reset_auth_attempt ( ) #NEWLINE# return signin_user_db ( result ) #NEWLINE# #UNINDENT# if ( result is None ) : #NEWLINE# #INDENT# form . email . errors . append ( 'Email or Password do not match' ) #NEWLINE# #UNINDENT# if ( result is False ) : #NEWLINE# #INDENT# return flask . redirect ( flask . url_for ( 'welcome' ) ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not form . errors ) : #NEWLINE# #INDENT# form . next_url . data = next_url #NEWLINE# #UNINDENT# #UNINDENT# if ( form and form . errors ) : #NEWLINE# #INDENT# cache . bump_auth_attempt ( ) #NEWLINE# #UNINDENT# return flask . render_template ( 'auth/auth.html' , title = 'Sign in' , html_class = 'auth' , next_url = next_url , form = form , form_type = ( 'signin' if config . CONFIG_DB . has_email_authentication else '' ) , ** urls_for_oauth ( next_url ) )