Remove password confirmation; devise - ruby-on-rails-3

I am using devise for authentication in my Rails 3.2.6 app. I had password confirmation first but now I want to remove it. How to go about that?

You just need to remove the password_confirmation field from your form.
More info in this answer.

Related

devise redirects to login after login

When a user logins into my page it redirects them to the sign-in page without error. It actually logs them in but for some reason it won't redirect to the user's show page.
I have this, which as worked in other cases, in my application controller:
def after_sign_in_path_for(user)
user_url(user)
end
here is the link to my repo https://github.com/samwat2/Ships-Project
I'm new to rails and I'm not quiet sure this isn't working! When it has before...
From looking at your repo, you added the two custom fields :first_name and :last_name to the registration form, and you validate the presence of those attributes. If you have added these validations after creating some users, and try to login with a user that misses some of these fields, devise will encounter a validation error when saving the user and redirect back to the login form, even though the authentication itself was successful.
Try making the users valid by filling the missing attributes, and the login should behave again as intended.

Activeadmin and devise in rails 4

I am using active admin and devise in rails 4. When i am logging out to the active admin user it will automatically logging out to the devise user also.
Any help would be appreciated....
Thanks
You could set a custom logout path in your active_admin.rb file. Look for the line with config.logout_link_path

Password being sent in cleartext in rails 3

In my application i am using restful authentication for authenticating login. But the problem is whenever i login and check the logs, my password is sent in cleartext and it is easily readable. I tried many things but still the issue exists.
Any idea on how to fix this.
Found the solution.
In application.rb just add the following line, the remaining will be taken care;
config.filter_parameters << :password

Rails RESTful API + Devise - How to check for user's credentials

I've built a RESTful API with Ruby On Rails, and now I good like to know whether the user's credentials received by POST are valid or not, using Devise.
Any ideas?
Devise - getting started should set you up.
EDIT:
Devise, by default, validates users by their email and password. If you want to add validation by username, refer this wiki
Basically, you need to add username to the model and make it 'attr-accessible'
Devise sets up paths for user sign-up, sign-in and sign-out, etc.
Refer devise asciicast for these path helpers.
To write controller tests, refer to this wiki for details.
EDIT:
Sorry for not understanding your requirements. Here is how to find user from credentials. This you can use from your service to validate user.

Ruby gem to quickly make a login validation

I have a webservice -somewhere- to validate passwords and stuff, and a module using SAVON that makes the corresponding questions in order to verify someone. The thing is, I don't have the login to work with my module. I was trying to use DEVISE to work with it, but I can't figure out how to do it yet.
Does anybody know a good gem that can work and take advantage of SAVON in order to make login validations?
I don't know of any gem that works with SAVON but you can use find_for_database_authentication of Devise
def self.find_for_database_authentication(conditions)
where('users.rut = ?', conditions[:rut]).first
end
For more detail, see RoR Devise: Sign in with username OR email