Skip to content

Commit

Permalink
removed resque JWT::DecodeError that caused error undetected
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs02 committed Feb 24, 2016
1 parent 6badac5 commit e3d0aa6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/server/ruby/app/models/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class Token
def initialize token
@payload = JWT.decode(token, JWT_SECRET, JWT_ALGORITHM).first.with_indifferent_access
@user_id = @payload[:user_id]
rescue JWT::DecodeError
nil
end

def valid?
Expand All @@ -19,4 +17,4 @@ def self.encode user_id
JWT.encode({ user_id: user_id, exp: (DateTime.now + 30).to_i }, JWT_SECRET, JWT_ALGORITHM)
end

end
end

0 comments on commit e3d0aa6

Please sign in to comment.