Closed caioertai closed 3 years ago
@jamiesonreinhard
I updated it with the user login endpoint. It's working as intended, although SUPER slow in development since it doesn't cache the access token by default. It's NOT an issue, since I'll probably mockup their API in development to make sure we're not even talking to them.
# 1. Init anything that answers #email. More generally, user instances.
user = OpenStruct.new(email: "andrade@hey.com")
# 2. Initialize service
service = Lawhub::User.new(user)
# 3. Call login instance method
service.login
user = User.find("XX")
user.lawhub.login
I added @jamiesonreinhard a section about usage in case you need it later.
Closes #132
@jamiesonreinhard this is part of the #132.
Credentials update
I updated the app credentials, which means I'll need to share with you my
master.key
file at some point in order for this to work for you. Let me know when you're free for a call about it.Lawhub service module and ::Authentication
I created
Lawhub
as a class with some configurations that should be shared by other endpoints andLawhub::Authentication
which is essentially a class that holds the#access_token
method, behind a rails' low level caching API.Lawhub::User
Should have methods relating to particular users. Right now the only one that matters is the login ping endpoint. It could later include things like info request or subscription confirmations.
Edit:
Usage
Interface idea: add a Lawhub module for User