symfony fosuser resseting password issue with validator - validation

I have an issue when i am resetting a password. In my entity i have a Constraint , who check if my field already exist in DB.
it's work fine. But if i aske a password reset , when i validate new password, i have a validator (my constraint) message , and the password is not change.
the probleme is that the resseting class form->isValid() from ResettingController use my constraint. I dont want that when i'm resetting a password. There is a way to tell symfony don't use validator on resseting password for form->isValid() ? Or a way to know if the request come from reseting process in my validator class?

The only way that i found , it's to use session and put a flag. Not very awesome.

Related

WDIO is not entering value in password text wrap field[React native web]

We are automating a react native web application on mobile web browser using WebdriverIO,Appium,mocha framework
while we navigate the URL, signIN page will open to login for the user
script able to enter user text on userName field but password value not entering the value in password field , we can able click on this but text not entering
Source:
Code:
$('#LogInModel_UserName').waitForExist();
$('#LogInModel_UserName').addValue("mytesting#gmail.com");
$('#login-password').waitForExist();
$('#login-password').addValue("passme"); // here its the entering blank instead of "passme"
Can someone share some solution ,how can i enter password value in password field?
Thanks In Advance,
from looking at your screenshot and code snippet, I believe the issue is that you are targeting the wrong element.
You want to target the id on the password input field which is #LogInModel_Password.
So your code would be:
$('#LogInModel_UserName').waitForExist();
$('#LogInModel_UserName').addValue("mytesting#gmail.com");
$('#LogInModel_Password').waitForExist();
$('#LogInModel_Password').addValue("passme")
This should fix your issue since it looks like you are already targeting the username field correctly and it works.

How to encrypt mongo db password with jasypt?

spring.data.mongodb.uri=mongodb://user:secret#mongo1.example.com:12345,mongo2.e
xample.com:12345/mydb?replicaSet=rsdb
Here i want to encript the password(secret)with jasypt.So the url should be
like:
spring.data.mongodb.uri=mongodb://user:ENC(xIZhIV7nvOv5LqHfAKnvmjhyeecOT0lO)#mongo1.example.com:12345,mongo2.example.com:12345/mydb?replicaSet=rsdb
but mongo is not understanding the password even if the jasypt encryption logic is already implemented.
I got the solution:
Since it is not resolving encrypted value from url, we can put it in it's own property and then reference that property in the url.
spring.data.mongodb.password=ENC(xIZhIV7nvOv5LqHfAKnvmjhyeecOT0lO)
spring.data.mongodb.uri=mongodb://user:${spring.data.mongodb.password}#mongo1.example.com:12345,mongo2.example.com:12345/mydb?replicaSet=rsdb

Override default username validation of MembershipReboot

I'm using Thinktecture IdentityServer with MembershipReboot and i'm trying to find a way to override the default username validation of username.
my case is that I want to allow username to be email or not and not the same as the user email.
The username validation is configured in UserAccountService, I can add validation but I Don't know how to remove them.
I'd simply like to remove the validatior UsernameDoesNotContainAtSign and UsernameOnlyContainsLettersAndDigits, and do that without any modification of MembershipReboot, through configuration or ?
Edit:
Related GitHub issues:
https://github.com/brockallen/BrockAllen.MembershipReboot/issues/331
https://github.com/brockallen/BrockAllen.MembershipReboot/issues/339
https://github.com/brockallen/BrockAllen.MembershipReboot/issues/370
Some of these validation rules are hard coded. If you have a use case for changing them, I'd suggest opening an issue on the github issue tracker so we can discuss.

User registration using Spring Hibernate jsp mySQL

My Applicatoin is based on Spring 3, Hibernate, JSP and MySQL DB
While registering user, I want to check if username exists in DB. What is the best way to achieve this? can someone please provide example or reference to other posts?
I have tried below stuff so far
On submit of a page, I have a service call in controller which returns user object (if username exists) otherwise null. i.e. "public User userService.getUser(userName)"
I dont know how to pass the message to jsp so posting this message
I am not sure if this is the correct approach? of not please suggest
better one
I'll make a ajax call to check the existence of user by calling the this function inside the controller, and display the appropriate message if the user already exist.
public boolean isUserExist(String userName)
{
return userDao.isExist(userName);
}

Forcing a revalidate on mvc3 unobtrusive remote validation

It's a classic login flow. The user can choose between 'new user' or 'existing user'. If the user is new, the name in the login box should validate against the server to see if the username is unique, if it's an existing user this check will be skipped since we expect the username to be taken already (ofcourse).
I added a [Remote] attribute on the viewmodel and added the radiobutton for new/exiting user as 'additional fields'. This way the remote validation will just return true if it's an existing user, and check the database if it's not, to see if the username is taken.
This works great, except when the user decides to change the radiobutton (new/existing) after entered a username (and the remote validation has run). Since remote validation is only automatically run when the username changes (that's the property with [Remote] attribute), changing the radiobutton alone, will not have it run again.
So my problem is, how can i force the remote validation to run again? I tried the usual hacks by triggering a change/focus/blur event on the username input field, but the call is not triggered. I considered adding a similar [Remote] on the radiobutton, but that would really complicate things with two equal looking error messages, placed at the same absolute position.
Is there any way to trigger a revalidation?
I believe that jquery validation can be triggered using $("#formID").validate()
Some more options can be found in the docs: http://docs.jquery.com/Plugins/validation, and at Brad Wilson's blog (you can also find some info in the comments)
Have you looked into the Data attributes that the input has, maybe it's cached? something like this.
EDIT: Just for clarification, this is how i got it to work
$('#UserName').removeData('previousValue');
$('form').validate().element('#UserName');

Resources