Skip to content

Commit e9b87dc

Browse files
erdostomKrisztian Szabo
authored andcommitted
checking for expired token as part of authenticated?
Conflicts: lib/mkto_rest.rb
1 parent 20a1c68 commit e9b87dc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/mkto_rest.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def debug=(bool)
2323
end
2424

2525
def authenticated?
26-
!@token.empty?
26+
!@token.empty? && token_valid?
27+
end
28+
29+
def token_valid?
30+
return Time.now < @valid_until
2731
end
2832

2933
# used for testing only

0 commit comments

Comments
 (0)