-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return credentials field in login mutation
- Loading branch information
1 parent
e033121
commit 1633d78
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module GraphqlDevise | ||
module Types | ||
class CredentialType < GraphQL::Schema::Object | ||
field :access_token, String, null: false | ||
field :uid, String, null: false | ||
field :token_type, String, null: false | ||
field :client, String, null: false | ||
field :expiry, Int, null: false | ||
|
||
def access_token | ||
object[DeviseTokenAuth.headers_names[:"access-token"]] | ||
end | ||
|
||
def uid | ||
object[DeviseTokenAuth.headers_names[:uid]] | ||
end | ||
|
||
def token_type | ||
object[DeviseTokenAuth.headers_names[:"token-type"]] | ||
end | ||
|
||
def client | ||
object[DeviseTokenAuth.headers_names[:client]] | ||
end | ||
|
||
def expiry | ||
object[DeviseTokenAuth.headers_names[:expiry]] | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters