Skip to content

Commit 0a039cb

Browse files
committed
Refine revoked getter and improve enumeration
Changed the `revoked` getter to a nilable type for consistent handling of null values in JSON serialization, avoiding potential bugs. Improved the `each` method in the in-memory JTI provider by utilizing block notation, simplifying code readability and maintainability. These enhancements streamline data handling and iteration in the codebase.
1 parent 447dd79 commit 0a039cb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/authly/access_token.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Authly
99
getter access_token : String
1010
getter token_type : String = "Bearer"
1111
getter expires_in : Int64 = ACCESS_TTL.from_now.to_unix
12-
getter revoked : Bool = false
12+
getter? revoked : Bool = false
1313
@[JSON::Field(emit_null: false)]
1414
getter refresh_token : String
1515
@[JSON::Field(emit_null: false)]

src/authly/in_memory_jti_provider.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Authly
99
end
1010

1111
# Implement the each method to make the class enumerable
12-
def each
12+
def each(&)
1313
@revoked_tokens.each { |jti| yield jti }
1414
end
1515

0 commit comments

Comments
 (0)