Skip to content

Commit

Permalink
Merge pull request #245 from CaritasDeutschland/feature-two-factor-auth
Browse files Browse the repository at this point in the history
Feature two factor auth
  • Loading branch information
mebo4b authored Dec 7, 2021
2 parents 799bddc + c664473 commit 82d648c
Show file tree
Hide file tree
Showing 81 changed files with 1,962 additions and 484 deletions.
1 change: 0 additions & 1 deletion config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ module.exports = {
appPublic: resolveApp('public'),
appEntryPoints: {
app: resolveModule(resolveApp, 'src/initApp'),
login: resolveModule(resolveApp, 'src/initLogin'),
error: resolveModule(resolveApp, 'src/initError')
},
appPackageJson: resolveApp('package.json'),
Expand Down
10 changes: 0 additions & 10 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,6 @@ module.exports = function (webpackEnv) {
chunks: ['app'],
filename: 'beratung-hilfe.html',
}),
new HtmlWebpackPlugin({
title: 'Login',
templateParameters: {
type: 'login',
},
inject: true,
template: 'src/pages/app.html',
chunks: ['login'],
filename: 'login.html',
}),
new HtmlWebpackPlugin({
title: 'Error Page 401',
templateParameters: {
Expand Down
2 changes: 1 addition & 1 deletion config/webpackDevServer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = function (proxy, allowedHost) {
disableDotRule: true,
index: paths.publicUrlOrPath,
rewrites: [
{ from: /^\/$/, to: '/login.html' },
{ from: /^\/$/, to: '/beratung-hilfe.html' },
{ from: /^\/.+/, to: '/beratung-hilfe.html' },
]
},
Expand Down
16 changes: 7 additions & 9 deletions cypress/integration/profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('profile', () => {
);
});

it('can register for a new consulting type with an external agency', () => {
it.skip('can register for a new consulting type with an external agency', () => {
cy.intercept(
config.endpoints.agencyServiceBase +
'?postcode=00000&consultingType=0',
Expand All @@ -40,7 +40,7 @@ describe('profile', () => {
cy.caritasMockedLogin();
cy.visit('/beratung-hilfe.html', {
onBeforeLoad(window) {
cy.stub(window, 'open');
cy.spy(window, 'open').as('windowOpen');
}
});
cy.contains('Profil').click();
Expand All @@ -59,13 +59,11 @@ describe('profile', () => {
);

cy.contains('Jetzt wechseln').click();
cy.window()
.its('open')
.should(
'be.calledWith',
'https://www.onlineberatung-diakonie-baden.de/',
'_blank'
);
cy.get('@windowOpen').should(
'be.calledWith',
'https://www.onlineberatung-diakonie-baden.de/',
'_blank'
);
});

it('can register for a new consulting type with an internal agency', () => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/sessions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('Sessions', () => {
cy.get('.sessionsListItem').should('exist');

cy.get('.sessionsList__scrollContainer').scrollTo('bottom');
cy.get('#loginRoot').should('exist');
cy.get('.loginForm').should('exist');
});
});
});
Expand Down
8 changes: 4 additions & 4 deletions cypress/integration/tokens.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('Keycloak Tokens', () => {
waitForTokenProcessing();

cy.tick(1000); // logout() call uses setTimeout
cy.get('#loginRoot').should('exist');
cy.get('.loginForm').should('exist');
});

//TODO: inspect this test, as there seems to be a race condition
Expand All @@ -112,7 +112,7 @@ describe('Keycloak Tokens', () => {
waitForTokenProcessing();

cy.tick(1000); // logout() call uses setTimeout
cy.get('#loginRoot').should('exist');
cy.get('.loginForm').should('exist');
});

it('should not logout if refresh token is expired but access token is still valid', () => {
Expand All @@ -126,7 +126,7 @@ describe('Keycloak Tokens', () => {
waitForTokenProcessing();

cy.tick(1000); // logout() call uses setTimeout
cy.get('#loginRoot').should('not.exist');
cy.get('.loginForm').should('not.exist');
});

it('should not logout if refresh token is expired but access token is still valid when the app loads', () => {
Expand All @@ -146,6 +146,6 @@ describe('Keycloak Tokens', () => {
waitForTokenProcessing();

cy.tick(1000); // logout() call uses setTimeout
cy.get('#loginRoot').should('not.exist');
cy.get('.loginForm').should('not.exist');
});
});
4 changes: 2 additions & 2 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ Cypress.Commands.add(

cy.intercept('POST', config.endpoints.rejectVideoCall, {});

cy.visit('login.html');
cy.visit('/login');

cy.get('#loginRoot');
cy.get('.loginForm');
cy.get('#username').type('username', { force: true });
cy.get('#passwordInput').type('password', {
force: true
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// Page components
export { App } from './src/components/app/app';
export { Login } from './src/components/login/Login';
export { Error } from './src/components/error/Error';

// Component library
Expand All @@ -20,6 +19,7 @@ export * from './src/components/overlay/Overlay';
export * from './src/components/serviceExplanation/ServiceExplanation';
export * from './src/components/inputField/InputField';
export * from './src/components/agencySelection/agencySelectionHelpers';
export * from './src/components/profile/AskerRegistrationExternalAgencyOverlay';

// Images
export * from './src/resources/img/icons';
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
server_tokens off;

location = / {
index /login.html;
index /beratung-hilfe.html;
}

location / {
Expand Down
Loading

0 comments on commit 82d648c

Please sign in to comment.