#NEWLINE# @ gen . coroutine #NEWLINE# def post( self ) : #NEWLINE# #INDENT# self . check_xsrf_cookie ( ) #NEWLINE# password = self . get_argument ( 'password' ) #NEWLINE# password_hash = ( yield self . application . pool . submit ( bcrypt . hashpw , password , self . api_data . password ) ) #NEWLINE# if ( password_hash == self . api_data . password ) : #NEWLINE# #INDENT# self . set_secure_cookie ( 'user' , self . api_dir ) #NEWLINE# self . redirect ( self . get_argument ( 'next' , '/__manage' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . set_flash_message ( 'error' , 'Password is not valid.' ) #NEWLINE# self . redirect ( ( '/__manage/login?next=%s' % self . get_argument ( 'next' , '/__manage' ) ) )