File tree 1 file changed +3
-3
lines changed
app/models/devise_token_auth/concerns
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -137,17 +137,17 @@ def token_is_current?(token, client)
137
137
def token_can_be_reused? ( token , client )
138
138
# ghetto HashWithIndifferentAccess
139
139
updated_at = tokens [ client ] [ 'updated_at' ] || tokens [ client ] [ :updated_at ]
140
- last_token = tokens [ client ] [ 'last_token' ] || tokens [ client ] [ :last_token ]
140
+ last_token_hash = tokens [ client ] [ 'last_token' ] || tokens [ client ] [ :last_token ]
141
141
142
142
return true if (
143
143
# ensure that the last token and its creation time exist
144
- updated_at && last_token &&
144
+ updated_at && last_token_hash &&
145
145
146
146
# ensure that previous token falls within the batch buffer throttle time of the last request
147
147
updated_at . to_time > Time . zone . now - DeviseTokenAuth . batch_request_buffer_throttle &&
148
148
149
149
# ensure that the token is valid
150
- DeviseTokenAuth ::TokenFactory . valid_token_hash? ( last_token )
150
+ DeviseTokenAuth ::TokenFactory . token_hash_is_token? ( last_token_hash , token )
151
151
)
152
152
end
153
153
You can’t perform that action at this time.
0 commit comments