#NEWLINE# def decode_token( self , request , token ) : #NEWLINE# #INDENT# if ( not jwt ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( 'JWT library not available' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return jwt . decode ( token , request . config [ 'SECRET_KEY' ] ) #NEWLINE# #UNINDENT# except jwt . ExpiredSignature : #NEWLINE# #INDENT# request . app . logger . warning ( 'JWT token has expired' ) #NEWLINE# raise Http401 ( 'Token' ) #NEWLINE# #UNINDENT# except jwt . DecodeError as exc : #NEWLINE# #INDENT# request . app . logger . warning ( str ( exc ) ) #NEWLINE# raise Http401 ( 'Token' )