Problem:
In development:
To test run GraphQL Mutation updateUser you have to manually fake authentication,
or explicit write a valid email, that you know exists in the databse, when the user credential is updated for that user.
Solution:
Add a fake user to database with a known email.
This is done in config folder in a seperate class as CommandLineRunner.
Create a custom DevAuthenticationFilter extends GenericFilterBean that sets the fake users authentication.
Update developmentSecurityFilterChain() with:
.addFilterBefore(DevAuthenticationFilter, BasicAuthenticationFilter.class)
Defenition of done:
In development it is possible to make requests to /graphql without explicit write a valid email in code
or fake authentication.
Problem:
In development:
To test run GraphQL Mutation
updateUseryou have to manually fake authentication,or explicit write a valid email, that you know exists in the databse, when the user credential is updated for that user.
Solution:
Add a fake user to database with a known email.
This is done in config folder in a seperate class as
CommandLineRunner.Create a custom
DevAuthenticationFilter extends GenericFilterBeanthat sets the fake users authentication.Update
developmentSecurityFilterChain()with:.addFilterBefore(DevAuthenticationFilter, BasicAuthenticationFilter.class)Defenition of done:
In development it is possible to make requests to
/graphqlwithout explicit write a valid email in codeor fake authentication.