Skip to content

Commit

Permalink
impl Client#user_info
Browse files Browse the repository at this point in the history
  • Loading branch information
nna774 committed Dec 13, 2024
1 parent eb4d1d1 commit 3845c33
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/rubysky/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@ def user_did
@client.session.did_doc.did_doc
end

def user_info
{
"pds" => @client.pds,
"access_jwt" => @client.session.access_jwt,
"refresh_jwt" => @client.session.refresh_jwt,
"did" => @client.session.did_doc.did,
"did_doc" => @client.session.did_doc.did_doc,
"email" => @client.session.email,
"email_confirmed" => @client.session.email_confirmed,
"email_auth_factor" => @client.session.email_auth_factor,
"active" => @client.session.active,
"status" => @client.session.status
}.compact
end

def handle
@client.session.handle
end
Expand Down
1 change: 1 addition & 0 deletions sig/rubysky.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module RubySky
def post: (text: String, images: Array[{data: IO, mime_type: String, ?alt: String}]) -> Post
def refresh_jwt: () -> String
def user_did: () -> Hash[String, untyped]
def user_info: () -> Hash[String, untyped]
def handle: () -> String

attr_reader client: Raw::Client
Expand Down

0 comments on commit 3845c33

Please sign in to comment.