You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do not use the issues tracker for help or support, try Stack Overflow.
For bugs, do a quick search and make sure the bug has not yet been reported
If you found a security bug, do not report it through GitHub. Please send an e-mail to [email protected] instead.
Finally, be nice and have fun!
Environment
Ruby 3.3.4
Rails 7.2.1
Devise 4.9.4
Current behavior
File path: lib/devise/strategies/authenticatable.rb
Line number: 93
In case of REST api,
defparams_auth_hashparams[scope]end
returns authentication infos such as email and password from params = { user: { email: "[email protected]", password: "Password"} }
But in case of GraphQL(graphql gem), params is not a normal hash but rather:
Easiest work around by @lit-poks is to override in your application.
moduleDevisemoduleStrategiesclassAuthenticatable < Base# overriding the default paramsdefparams@params ||= {user: log_in_params}endprivatedeflog_in_params# Adjust this accordingly and extract auth has accordingly. Also, important# note here is, auth_hash must be symbolized.request.params.dig(:variables,:input,:attributes) || params_from_argumentsenddefparams_from_argumentsarguments.value.arguments.inject({})do |attributes,argument|
attributes.merge!(argument.name.underscore.to_sym=>argument.value)endenddefargumentsGraphQL::Query.new(D2dSchema,request.params[:query]).document.definitions[0].selections[0].arguments[0].value.arguments[0]endendendend
Since this affects the authenticable module, you might face issues indirectly in cookies, remember_user_token, etc.
Credit: This issue was initially faced by my friend @lit-poks and gave me the above workaround. Thanks man!
Expected behavior
The text was updated successfully, but these errors were encountered:
Pre-check
Environment
Current behavior
File path:
lib/devise/strategies/authenticatable.rb
Line number: 93
In case of REST api,
returns authentication infos such as email and password from
params = { user: { email: "[email protected]", password: "Password"} }
But in case of GraphQL(
graphql
gem), params is not a normal hash but rather:Easiest work around by @lit-poks is to override in your application.
Since this affects the authenticable module, you might face issues indirectly in cookies, remember_user_token, etc.
Credit: This issue was initially faced by my friend @lit-poks and gave me the above workaround. Thanks man!
Expected behavior
The text was updated successfully, but these errors were encountered: