graphql-auth 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/app/graphql/mutations/{forgot_password.rb → auth/forgot_password.rb} +1 -1
- data/app/graphql/mutations/{reset_password.rb → auth/reset_password.rb} +2 -2
- data/app/graphql/mutations/{sign_in.rb → auth/sign_in.rb} +3 -3
- data/app/graphql/mutations/{sign_up.rb → auth/sign_up.rb} +3 -3
- data/app/graphql/mutations/{update_account.rb → auth/update_account.rb} +3 -3
- data/app/graphql/mutations/{validate_token.rb → auth/validate_token.rb} +3 -3
- data/app/graphql/types/{error.rb → auth/error.rb} +1 -1
- data/app/graphql/types/{user.rb → auth/user.rb} +1 -1
- data/lib/generators/graphql_auth/templates/initializer.rb +6 -6
- data/lib/graphql-auth/configuration.rb +6 -6
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ce2f9bb33a4c20dcb1d1b43ef8dfcdc2f81e781
|
4
|
+
data.tar.gz: b5d3237050911410dee11cfa3c6690527a6742d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3078cb321ac833dc34314a7ba6027602f7392d9e694e42a35eb46f1dd21ee1f5fe060f88183cbf9e876ae4a3e1d51e5e7361e2c0137d1be1b1b3749f0a2dd912
|
7
|
+
data.tar.gz: 9afb297a06f9e06d814e00b8845777ca14b48a9ac6267393749e95ee3a3cfe6a655e3619a640f07a4db9a2baa5883cb809592732b574182ac33c18059dd74c36
|
data/README.md
CHANGED
@@ -67,11 +67,11 @@ class GraphqlController < ActionController::API
|
|
67
67
|
...
|
68
68
|
```
|
69
69
|
|
70
|
-
Make sure to implement `GraphqlAuth` in your MutationType
|
70
|
+
Make sure to implement `GraphqlAuth` in your `MutationType` to make auth mutations available
|
71
71
|
|
72
72
|
```
|
73
73
|
class Types::MutationType < Types::BaseObject
|
74
|
-
implements GraphqlAuth
|
74
|
+
implements ::Types::GraphqlAuth
|
75
75
|
end
|
76
76
|
```
|
77
77
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
# }
|
11
11
|
# }
|
12
12
|
|
13
|
-
class Mutations::ResetPassword < GraphQL::Schema::Mutation
|
13
|
+
class Mutations::Auth::ResetPassword < GraphQL::Schema::Mutation
|
14
14
|
argument :reset_password_token, String, required: true do
|
15
15
|
description "Reset password token"
|
16
16
|
end
|
@@ -24,7 +24,7 @@ class Mutations::ResetPassword < GraphQL::Schema::Mutation
|
|
24
24
|
end
|
25
25
|
|
26
26
|
field :valid, Boolean, null: false
|
27
|
-
field :errors, [Types::Error], null: true
|
27
|
+
field :errors, [Types::Auth::Error], null: true
|
28
28
|
|
29
29
|
def resolve(args)
|
30
30
|
user = User.reset_password_by_token args
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# }
|
13
13
|
# }
|
14
14
|
|
15
|
-
class Mutations::SignIn < GraphQL::Schema::Mutation
|
15
|
+
class Mutations::Auth::SignIn < GraphQL::Schema::Mutation
|
16
16
|
argument :email, String, required: true do
|
17
17
|
description "The user's email"
|
18
18
|
end
|
@@ -21,8 +21,8 @@ class Mutations::SignIn < GraphQL::Schema::Mutation
|
|
21
21
|
description "The user's password"
|
22
22
|
end
|
23
23
|
|
24
|
-
field :user, Types::User, null: true
|
25
|
-
field :errors, [Types::Error], null: true
|
24
|
+
field :user, Types::Auth::User, null: true
|
25
|
+
field :errors, [Types::Auth::Error], null: true
|
26
26
|
|
27
27
|
def resolve(email:, password:)
|
28
28
|
response = context[:response]
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# }
|
13
13
|
# }
|
14
14
|
|
15
|
-
class Mutations::SignUp < GraphQL::Schema::Mutation
|
15
|
+
class Mutations::Auth::SignUp < GraphQL::Schema::Mutation
|
16
16
|
argument :email, String, required: true do
|
17
17
|
description "New user's email"
|
18
18
|
end
|
@@ -25,8 +25,8 @@ class Mutations::SignUp < GraphQL::Schema::Mutation
|
|
25
25
|
description "New user's password confirmation"
|
26
26
|
end
|
27
27
|
|
28
|
-
field :user, Types::User, null: true
|
29
|
-
field :errors, [Types::Error], null: true
|
28
|
+
field :user, Types::Auth::User, null: true
|
29
|
+
field :errors, [Types::Auth::Error], null: true
|
30
30
|
|
31
31
|
def resolve(args)
|
32
32
|
response = context[:response]
|
@@ -12,7 +12,7 @@
|
|
12
12
|
# }
|
13
13
|
# }
|
14
14
|
|
15
|
-
class Mutations::UpdateAccount < GraphQL::Schema::Mutation
|
15
|
+
class Mutations::Auth::UpdateAccount < GraphQL::Schema::Mutation
|
16
16
|
argument :current_password, String, required: true do
|
17
17
|
description "User's current password"
|
18
18
|
end
|
@@ -25,8 +25,8 @@ class Mutations::UpdateAccount < GraphQL::Schema::Mutation
|
|
25
25
|
description "User's new password confirmation"
|
26
26
|
end
|
27
27
|
|
28
|
-
field :user, Types::User, null: true
|
29
|
-
field :errors, [Types::Error], null: true
|
28
|
+
field :user, Types::Auth::User, null: true
|
29
|
+
field :errors, [Types::Auth::Error], null: true
|
30
30
|
|
31
31
|
def resolve(args)
|
32
32
|
user = context[:current_user]
|
@@ -9,11 +9,11 @@
|
|
9
9
|
# }
|
10
10
|
# }
|
11
11
|
|
12
|
-
class Mutations::ValidateToken < GraphQL::Schema::Mutation
|
12
|
+
class Mutations::Auth::ValidateToken < GraphQL::Schema::Mutation
|
13
13
|
field :valid, Boolean, null: false
|
14
|
-
field :user, Types::User, null: true
|
14
|
+
field :user, Types::Auth::User, null: true
|
15
15
|
|
16
|
-
def resolve
|
16
|
+
def resolve
|
17
17
|
user = context[:current_user]
|
18
18
|
|
19
19
|
{
|
@@ -3,13 +3,13 @@ GraphQL::Auth.configure do |config|
|
|
3
3
|
# config.jwt_secret_key = ENV['JWT_SECRET_KEY']
|
4
4
|
# config.app_url = ENV['APP_URL']
|
5
5
|
|
6
|
-
# config.sign_in_mutation = ::Mutations::SignIn
|
7
|
-
# config.sign_up_mutation = ::Mutations::SignUp
|
6
|
+
# config.sign_in_mutation = ::Mutations::Auth::SignIn
|
7
|
+
# config.sign_up_mutation = ::Mutations::Auth::SignUp
|
8
8
|
|
9
|
-
# config.forgot_password_mutation = ::Mutations::ForgotPassword
|
10
|
-
# config.reset_password_mutation = ::Mutations::ResetPassword
|
9
|
+
# config.forgot_password_mutation = ::Mutations::Auth::ForgotPassword
|
10
|
+
# config.reset_password_mutation = ::Mutations::Auth::ResetPassword
|
11
11
|
|
12
|
-
# config.update_account_mutation = ::Mutations::UpdateAccount
|
12
|
+
# config.update_account_mutation = ::Mutations::Auth::UpdateAccount
|
13
13
|
|
14
|
-
# config.validate_token_mutation = ::Mutations::ValidateToken
|
14
|
+
# config.validate_token_mutation = ::Mutations::Auth::ValidateToken
|
15
15
|
end
|
@@ -16,15 +16,15 @@ module GraphQL
|
|
16
16
|
@jwt_secret_key = ENV['JWT_SECRET_KEY']
|
17
17
|
@app_url = ENV['APP_URL']
|
18
18
|
|
19
|
-
@sign_in_mutation = ::Mutations::SignIn
|
20
|
-
@sign_up_mutation = ::Mutations::SignUp
|
19
|
+
@sign_in_mutation = ::Mutations::Auth::SignIn
|
20
|
+
@sign_up_mutation = ::Mutations::Auth::SignUp
|
21
21
|
|
22
|
-
@forgot_password_mutation = ::Mutations::ForgotPassword
|
23
|
-
@reset_password_mutation = ::Mutations::ResetPassword
|
22
|
+
@forgot_password_mutation = ::Mutations::Auth::ForgotPassword
|
23
|
+
@reset_password_mutation = ::Mutations::Auth::ResetPassword
|
24
24
|
|
25
|
-
@update_account_mutation = ::Mutations::UpdateAccount
|
25
|
+
@update_account_mutation = ::Mutations::Auth::UpdateAccount
|
26
26
|
|
27
|
-
@validate_token_mutation = ::Mutations::ValidateToken
|
27
|
+
@validate_token_mutation = ::Mutations::Auth::ValidateToken
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guillaume Ferland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,42 +44,42 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.8
|
47
|
+
version: '1.8'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.8
|
54
|
+
version: '1.8'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: devise
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.4
|
61
|
+
version: '4.4'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.4
|
68
|
+
version: '4.4'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jwt
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.5
|
75
|
+
version: '1.5'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.5
|
82
|
+
version: '1.5'
|
83
83
|
description: GraphQL + JWT + Devise
|
84
84
|
email:
|
85
85
|
- ferland182@gmail.com
|
@@ -89,15 +89,15 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- Gemfile
|
91
91
|
- README.md
|
92
|
-
- app/graphql/mutations/forgot_password.rb
|
93
|
-
- app/graphql/mutations/reset_password.rb
|
94
|
-
- app/graphql/mutations/sign_in.rb
|
95
|
-
- app/graphql/mutations/sign_up.rb
|
96
|
-
- app/graphql/mutations/update_account.rb
|
97
|
-
- app/graphql/mutations/validate_token.rb
|
98
|
-
- app/graphql/types/error.rb
|
92
|
+
- app/graphql/mutations/auth/forgot_password.rb
|
93
|
+
- app/graphql/mutations/auth/reset_password.rb
|
94
|
+
- app/graphql/mutations/auth/sign_in.rb
|
95
|
+
- app/graphql/mutations/auth/sign_up.rb
|
96
|
+
- app/graphql/mutations/auth/update_account.rb
|
97
|
+
- app/graphql/mutations/auth/validate_token.rb
|
98
|
+
- app/graphql/types/auth/error.rb
|
99
|
+
- app/graphql/types/auth/user.rb
|
99
100
|
- app/graphql/types/graphql_auth.rb
|
100
|
-
- app/graphql/types/user.rb
|
101
101
|
- app/helpers/graphql/auth_helper.rb
|
102
102
|
- app/views/devise/mailer/reset_password_instructions.html.erb
|
103
103
|
- lib/generators/graphql_auth/install_generator.rb
|