Skip to content

Commit

Permalink
[frontend/backend] align login page with octi (#859)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumejparis authored Sep 3, 2024
1 parent 6bc5055 commit 47dbce5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private List<OAuthProvider> buildOpenIdProviders() {
return providers.entrySet().stream()
.map(entry -> {
String uri = "/oauth2/authorization/" + entry.getKey();
String clientName = env.getProperty("openex.provider." + entry.getKey() + ".login");
String clientName = env.getProperty("openbas.provider." + entry.getKey() + ".login");
// In case of missing name configuration, generate a generic name
if (clientName == null) {
clientName = "Login with " + entry.getKey();
Expand All @@ -118,7 +118,7 @@ private List<OAuthProvider> buildSaml2Providers() {
return providers.entrySet().stream()
.map(entry -> {
String uri = "/saml2/authenticate/" + entry.getKey();
String clientName = env.getProperty("openex.provider." + entry.getKey() + ".login");
String clientName = env.getProperty("openbas.provider." + entry.getKey() + ".login");
// In case of missing name configuration, generate a generic name
if (clientName == null) {
clientName = "Login with " + entry.getKey();
Expand Down
2 changes: 1 addition & 1 deletion openbas-front/src/public/components/login/LoginForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const LoginForm = (props) => {
name="username"
type="text"
variant="standard"
label={t('Email address')}
label={t('Login')}
fullWidth={true}
style={{ marginTop: 5 }}
/>
Expand Down
4 changes: 4 additions & 0 deletions openbas-front/src/utils/Localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ const i18n = {
'Send reset code': 'Envoyer le code',
'Enter code': 'Entrer le code',
'Back to login': "Retour à l'identification",
Login: 'Nom d\'utilisateur',
'Sign in': "S'identifier",
'Login with github': "S'identifier avec github",
'You probably need a public email in your github account':
"Vous avez probablement besoin d'une adresse e-mail publique dans votre compte github",
'Should be a valid email address': 'Doit être une adresse e-mail valide',
'Login with microsoft': "S'identifier avec microsoft",
'Corporate login': 'Connexion d\'entreprise',
Continue: 'Continuer',
Dashboard: 'Tableau de bord',
Players: 'Joueurs',
Expand Down Expand Up @@ -1302,12 +1304,14 @@ const i18n = {
'Send reset code': '发送重置代码',
'Enter code': '输入代码',
'Back to login': '返回登录',
Login: '登录',
'Sign in': '登录',
'Login with github': '使用github登录',
'You probably need a public email in your github account':
'你可能需要在GitHub中有一个公开邮件地址',
'Should be a valid email address': '应为有效邮件地址',
'Login with microsoft': '使用microsoft登录',
'Corporate login': '企业登录',
Continue: '继续',
Dashboard: '仪表盘',
Players: '选手',
Expand Down
4 changes: 2 additions & 2 deletions openbas-front/tests_e2e/model/login.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class LoginPage {
return this.page.getByTestId('login-page');
}

getEmailInput() {
return this.page.getByLabel('Email address');
getLoginInput() {
return this.page.getByLabel('Login');
}

getPasswordInput() {
Expand Down
2 changes: 1 addition & 1 deletion openbas-front/tests_e2e/utils/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const login = async (page: Page) => {
const loginPage = new LoginPage(page);
await expect(loginPage.getLoginPage()).toBeVisible();

await loginPage.getEmailInput().fill('[email protected]');
await loginPage.getLoginInput().fill('[email protected]');
await loginPage.getPasswordInput().fill('admin');
await loginPage.getSignInButton().click();

Expand Down

0 comments on commit 47dbce5

Please sign in to comment.