Skip to content

Commit

Permalink
Adding contentIsolation to the loginForm and removing the already dep…
Browse files Browse the repository at this point in the history
…recated/automated onlineCheckMethod config option
  • Loading branch information
IsmaelMartinez committed Nov 25, 2024
1 parent e430d4b commit 1cc81cf
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 85 deletions.
1 change: 0 additions & 1 deletion app/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Here is the list of available arguments and its usage:
| minimized | Boolean to start the application minimized | false |
| notificationMethod | Notification method to be used by the application (`web`/`electron`) | *web*, electron |
| ntlmV2enabled | Set enable-ntlm-v2 value | 'true' |
| onlineCheckMethod **automated - please remove** | Type of network test for checking online status. | *https*, dns, native, none |
| optInTeamsV2 | Boolean to opt in to use Teams V2 | false |
| partition | BrowserWindow webpreferences partition | persist:teams-4-linux |
| proxyServer | Proxy Server with format address:port (string) | null |
Expand Down
7 changes: 0 additions & 7 deletions app/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,6 @@ function extractYargConfig(configObject, appVersion) {
describe: 'Set enable-ntlm-v2 value',
type: 'string'
},
onlineCheckMethod: {
deprecated: 'It has been automated.\n Please remove this option from your config file',
default: 'https',
describe: 'Type of network test for checking online status.',
type: 'string',
choices: ['https', 'dns', 'native', 'none']
},
optInTeamsV2: {
default: false,
describe: 'Opt in to use Teams V2',
Expand Down
4 changes: 1 addition & 3 deletions app/login/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

This code handles the login dialog that appears when the app can login using ntlm.

[index.js](index.js) is the entry point that creates an electron browser window with the [login.html](login.html) content.

The [formSender.js](formSender.js) is the minimum js code that is needed to send the code username/password to the electron app in order to callback with the values.
[index.js](index.js) is the entry point that creates an electron browser window with the [login.html](login.html) content. The login.html is a simple html form that sends the username/password to the electron app using the formSender function.

The username/password aren't cached and the browserWindow gets remove once the form is submit.
15 changes: 0 additions & 15 deletions app/login/formSender.js

This file was deleted.

6 changes: 2 additions & 4 deletions app/login/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { app, ipcMain, BrowserWindow } = require('electron');
const { execSync } = require('child_process');
// const path = require('path');
const path = require('path');

let isFirstLoginTry = true;

Expand All @@ -15,9 +15,7 @@ exports.loginService = function loginService(parentWindow, callback) {
show: false,
autoHideMenuBar: true,
webPreferences: {
contextIsolation: false,
nodeIntegration: true
//preload: path.join(__dirname, 'preload.js')
preload: path.join(__dirname, 'preload.js')
}
});
win.once('ready-to-show', () => {
Expand Down
10 changes: 9 additions & 1 deletion app/login/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
color: rgb(255, 255, 255);">
</form>

<script src='formSender.js'></script>
<script>
function sendForm(event) {
event.preventDefault();
window.api.submitForm({
username: document.getElementById('username').value,
password: document.getElementById('password').value,
});
}
</script>
</body>

</html>
8 changes: 8 additions & 0 deletions com.github.IsmaelMartinez.teams_for_linux.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<url type="bugtracker">https://github.com/IsmaelMartinez/teams-for-linux/issues</url>
<launchable type="desktop-id">com.github.IsmaelMartinez.teams_for_linux.desktop</launchable>
<releases>
<release version="1.12.1" date="2024-11-25">
<description>
<ul>
<li>Improving security on the loginForm by removing the need of contentIsolation</li>
<li>Removing the already deprecated `onlineCheckMethod` option from the config options</li>
</ul>
</description>
</release>
<release version="1.12.0" date="2024-11-15">
<description>
<ul>
Expand Down
Loading

0 comments on commit 1cc81cf

Please sign in to comment.