#NEWLINE# def authenticate_user_cookie( nick , token ) : #NEWLINE# #INDENT# user = api . actor_get_safe ( api . ROOT , nick ) #NEWLINE# if ( not user ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# user . access_level = api . DELETE_ACCESS #NEWLINE# cached_token = lookup_user_auth_token ( user . nick , token ) #NEWLINE# if ( not cached_token ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# if ( user . password != cached_token ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return user