Recaptcha Gem Isn't Preventing Submit When Unchecked (Rails 5.2) - ruby-on-rails

I have what should be a very basic setup with the Recaptcha gem. It is showing all the appropriate on-page behavior: A recaptcha "I am not a robot" box appears on the sign up screen and is checkable by the user.
However, if I try and submit the sign in form without checking the box, it still goes through instead of showing an error message.
I followed the Gem's instructions pretty much verbatim:
I created the appropriate keys on Google's website and put them into
Heroku's variable storage successfully.
I put gem 'recaptcha' in my Gemfile and bundled.
I added <%= recaptcha_tags %> in my sign up form (Devise new user
registration).
I changed my create method to include if verify_recaptcha(model:
#user) && #user.persisted? in my registrations controller.
The box is showing up perfectly, but the user is able to create a new account even without checking the recaptcha box!
Can anyone see where I'm going wrong here? You can see the issue live here if you need to Google inspector it...

Related

Internal server error response during rails omniauth docusign callback

I am connecting to DocuSign via oauth with Rails 6 and Omniauth - it seems I have it configured correctly since visiting /auth/docusign takes me to the DocuSign login screen. After logging in, it takes me to the callback. The callback is failing because the omniauth-docusign gem is failing with the user_info hash. Where it should be getting user_info['accounts'] it is getting this:
user_info #=> {"error"=>"internal_server_error", "reference_id"=>"a0f0e8c9-2faa-4b70-90b8-875ae40f13cf"}
My API Dashboard for the App shows no log or request info. 0 total requests. Is there a log area for oauth attempts, or where to use this reference ID?
Can someone at DocuSign help with this? Your developer support page seems to say to ask here on S/O.
It appears that you didn't configure everything correctly for your Integration Key (IK which is like clientId) as well as clientSecret and the rest of the configuration that you can do for your IK.
I would suggest that you can get a pre-built Ruby application that already had this all done for you and save you some work by going to the Quickstart. This would enable you to go get a ZIP file pre-configurated with all the required gems and everything needed for auth already set based on your own developer account.
Update: if you then want to take this code into your own app, you need to also get the authentication code supplied lib/docusign.rb instead of a gem like omniauth-docusign.
As Inbar Gazit said, it's important to use the Quickstart app, which I was doing. However, not only do I already have my own existing rails app, even if I didn't, I wouldn't want to have to clean out all the extra stuff in the quickstart app that I don't need. It would be nice to have a minimal script for installing just the bare minimum into an existing rails app to get authenticated and start using the API.
In the end, the solution for me was to notice and copy the lib/docusign.rb file from the Quickstart app, instead of using an omniauth-docusign gem. The base omniauth gem had advised me to find and install that gem because there was no strategy defined for docusign. The quickstart lib file is what I needed.

How to edit the default dashboard from rails gem 'rails_admin'

I'm new to the gem rails_admin. I did some research but couldn't find a specific explanation that works well.
I already setup everything, when go to localhost:3000/admin, the dashboard shows up. But how can I edit it's dashboard. I already know it's a external resource.
Link to gemfile: https://github.com/sferik/rails_admin
I think you can't change or remove Dashboard action in rails_admin. However, you can create your custom action which located on root.
Take a look at this link. There is a description for creation of custom actions.

Devise Reset Password POSTs instead of PUT

I'm using a non customized version of Devise in my app and am running into some issues with the reset password functionality.
The default reset password form's method is to PUT but upon submitting the form, it POSTs which causes it to give me an error about a missing email field. The POST/create method in the PasswordsController of Devise is emailing the user the password reset link. The PUT/update method is for the actual resetting of the password.
None of the devise stuff is altered in any way. Devise version is 3.5.7 and Rails is 4.2.6
I've put all of the relevant code in a Gist here: https://gist.github.com/dsarhadian/a7950e480bffc2906f77b0e542792f5a
Any help is truly appreciated...
In your logs it says:
Rendered devise/passwords/edit.html.erb within layouts/application (3.3ms)
Are you sure that the edit.html.erb file renders the form.html.erb view?
Because when I look at the source.html file, it seems like it is rendering a different form which has the path for the POST method.
The form.html.erb uses the PUT method. So it seems to me like the wrong form is rendered.

Rails 3 Devise will look for the sign up page even though is deleted

I have this new Rails app. I installed Devise. I don't want people registering for new accounts so I deleted the appname/app/views/devise/registrations/new.html.erb file
but when I try to access the delete page, I should get a "no routes" error or something similar, but instead, Rails looks for the Sign Up page here /gems/ruby-1.9.2-p290/gems/devise-1.5.2/app/views/devise/registrations/new.html.erb
I don't want the sign up page to be accessible.
You should remove the :registerable symbol from the list of devise stuff in your User model. This will disable the sign up feature.

how to change devise's flash[:notice] in rails

I'm using rails 2.3.5 and devise 1.0.6.
I'm having users confirm account's with email.
However, when a new user sign's up the flash notice says "The user was successfully created" which it was but it doesn't tell the user that they need to confirm their their email unless they try to log in and devise's flash notice still doesn't explain that they have to confirm through email.
Where is this flash notice located in the gem and how can I change it? Or what is a better way to fix this problem.
Just enable i18n in your project and edit the default locale (en.devise.yml) or download new ones from
https://github.com/plataformatec/devise/wiki/i18n
Flash messages for the devise gem can be altered in the locales directory (YourRailsApp/config/locales/devise.en.yml).
Just change the devise.en.yml to your liking, it doesn't really take any programming knowledge.
If you are new to rails the locales directory is for I18n translations which is rails way of translating words albeit statically but it works well for simple projects.

Resources