Skip to content

Commit

Permalink
Fill OAuth username before login with OAuthUI (#130)
Browse files Browse the repository at this point in the history
* Fill OAuth username before login with OAuthUI
* Also use password

Co-authored-by: Ben Bucksch
  • Loading branch information
jermy-c authored Jul 11, 2024
1 parent 0d0e5df commit 17efef0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/logic/Mail/AutoConfig/saveConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MailAccount } from "../MailAccount";
import { AuthMethod, type MailAccount } from "../MailAccount";
import { SQLMailAccount } from "../SQL/SQLMailAccount";
import { ContactEntry, Person } from "../../Abstract/Person";
import { Folder, SpecialFolder } from "../../Mail/Folder";
Expand Down Expand Up @@ -60,6 +60,10 @@ export function fillConfig(config: MailAccount, emailAddress: string, password:
}
fillConfig(config.outgoing, emailAddress, password);
}
if (config.authMethod == AuthMethod.OAuth2) {
config.oAuth2.username = config.emailAddress; // Fill oAuth2 username before saving refresh token
config.oAuth2.setPassword(password);
}
}

function replaceVar(str: string, emailAddress: string): string {
Expand Down

0 comments on commit 17efef0

Please sign in to comment.