Method: Landable::Author.authenticate!

Defined in:
app/models/landable/author.rb

.authenticate!(username, token_id) ⇒ Object



6
7
8
9
10
# File 'app/models/landable/author.rb', line 6

def self.authenticate!(username, token_id)
  author = where(username: username).first
  return unless author && author.access_tokens.fresh.exists?(token_id)
  author
end