Implemented desktop OAuth2 account setup for Google and Microsoft. The flow uses the system browser and PKCE; access and refresh tokens stay in the main process and encrypted account store. OAuth connections use fixed provider endpoints, and existing password-based accounts remain supported. Android remains password-based in this phase.

This commit is contained in:
2026-10-17 00:51:23 +03:00
parent 1ef934045f
commit ea825adcc1
29 changed files with 943 additions and 71 deletions
+7 -1
View File
@@ -31,13 +31,18 @@ const davRemoteFields = {
};
const objectFieldSchemas = {
'mail:update-account': [{
'mail:update-account': [null, {
email: str(320), password: str(4096), displayName: str(80), imapHost: str(253), smtpHost: str(253),
authMethod: { type: 'enum', values: ['password', 'oauth2'] },
oauthProvider: { type: 'enum', values: ['google', 'microsoft'] },
reauthorizeOAuth: bool(),
signature: str(5000), notificationsEnabled: bool(), syncIntervalMinutes: num(),
rules: array(record(ruleFields), 50)
}],
'mail:connect': [{
email: str(320), password: str(4096), displayName: str(80), imapHost: str(253), smtpHost: str(253),
authMethod: { type: 'enum', values: ['password', 'oauth2'] },
oauthProvider: { type: 'enum', values: ['google', 'microsoft'] },
signature: str(5000), notificationsEnabled: bool(), syncIntervalMinutes: num(),
rules: array(record(ruleFields), 50)
}],
@@ -116,6 +121,7 @@ const schemas = {
'app:get-version': [],
'mail:get-account': [],
'mail:list-accounts': [],
'mail:list-oauth-providers': [],
'mail:select-account': ['string'],
'mail:remove-account': ['string'],
'mail:update-account': ['string', 'object'],