Skip to content

Commit

Permalink
update patching for Oauth's SecurityConfiguration.java
Browse files Browse the repository at this point in the history
Fix #40
  • Loading branch information
ruddell committed May 2, 2018
1 parent ffb3472 commit a8e5a15
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/boilerplate/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ module.exports = async function (context, props, jhipsterConfig) {
})
const securityConfigFile = (jhipsterConfig['generator-jhipster'].applicationType === 'monolith') ? 'SecurityConfiguration' : 'OAuth2SsoConfiguration'
if (fs.existsSync(`${jhipsterPathPrefix}${props.jhipsterDirectory}/src/main/java/${props.packageFolder}/config/${securityConfigFile}.java`)) {
await ignite.patchInFile(`${jhipsterPathPrefix}${props.jhipsterDirectory}/src/main/java/${props.packageFolder}/config/${securityConfigFile}.java`, { replace: '"/api/profile-info"', insert: '"/api/profile-info", "/api/auth-info"' })
await ignite.patchInFile(`${jhipsterPathPrefix}${props.jhipsterDirectory}/src/main/java/${props.packageFolder}/config/${securityConfigFile}.java`,
{
replace: '.antMatchers("/api/**").authenticated()',
insert: '.antMatchers("/api/auth-info").permitAll()\n .antMatchers("/api/**").authenticated()'
}
)
}
}
} else {
Expand Down

0 comments on commit a8e5a15

Please sign in to comment.