Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcaps committed Dec 1, 2023
1 parent 8c497fa commit d9c76b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/backend/routes/views/account/post/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ exports = module.exports = [
})

if (resp.status !== 201) {
const apiError = JSON.parse(resp.data)
req.query.flash = Buffer.from(JSON.stringify({

Check warning on line 115 in src/backend/routes/views/account/post/report.js

View check run for this annotation

Codecov / codecov/patch

src/backend/routes/views/account/post/report.js#L114-L115

Added lines #L114 - L115 were not covered by tests
class: 'alert-danger',
messages: { errors: [{ msg: 'Error while submitting the report form' }] },
messages: { errors: [{ msg: 'Error while submitting the report form' }, { msg: apiError.errors?.[0]?.detail || 'unknown api error' }] },
type: 'Error!'
})).toString('base64')

Expand Down
3 changes: 2 additions & 1 deletion src/backend/security/bootPassport.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const OidcStrategy = require('passport-openidconnect')
const refresh = require('passport-oauth2-refresh')
const { JavaApiClientFactory } = require('../services/JavaApiClientFactory')
const { UserRepository } = require('../services/UserRepository')
const { UserService } = require('../services/UserService')

module.exports.bootPassport = (expressApp, appConfig) => {
expressApp.use(passport.initialize())
Expand All @@ -27,7 +28,7 @@ module.exports.bootPassport = (expressApp, appConfig) => {
refreshToken
}

const apiClient = JavaApiClientFactory.createInstance(appConfig.apiUrl, oAuthPassport)
const apiClient = JavaApiClientFactory.createInstance(new UserService(), appConfig.apiUrl, oAuthPassport)
const userRepository = new UserRepository(apiClient)

Check warning on line 32 in src/backend/security/bootPassport.js

View check run for this annotation

Codecov / codecov/patch

src/backend/security/bootPassport.js#L31-L32

Added lines #L31 - L32 were not covered by tests

userRepository.fetchUser(oAuthPassport).then(user => {
Expand Down

0 comments on commit d9c76b8

Please sign in to comment.