Use native Chrome for Reddit login handoff
This commit is contained in:
1 parent
2c533fa52a
commit
dbb1842ef4
13 files changed
+324
-60
No files matched your search
+3
-1
@@ -36,6 +36,7 @@ import {
|
||||
authenticateCurrentAccount,
|
||||
type AuthenticatedAccount,
|
||||
} from './services/account-auth-context.js';
|
||||
import { ProcessNativeLoginHandoff } from './services/native-login-handoff.js';
|
||||
|
||||
export interface AppContainer {
|
||||
config: Config;
|
||||
@@ -111,7 +112,7 @@ export async function bootstrap(config: Config, logger: Logger): Promise<AppCont
|
||||
if (!loggedIn) {
|
||||
logger.warn('Session invalid or not logged in.');
|
||||
|
||||
if (config.reddit.username && config.reddit.password) {
|
||||
if (!config.web.enabled && config.reddit.username && config.reddit.password) {
|
||||
logger.info('Credentials found in config/env. Attempting automated login...');
|
||||
loggedIn = await browserClient.login();
|
||||
}
|
||||
@@ -327,6 +328,7 @@ export async function bootstrap(config: Config, logger: Logger): Promise<AppCont
|
||||
webServer.setStrategySelector(strategySelector);
|
||||
webServer.setBrowserClient(browserClient);
|
||||
webServer.setAccountAuthContext(accountAuth);
|
||||
webServer.setNativeLoginHandoff(new ProcessNativeLoginHandoff());
|
||||
webServer.setOnConfigChange(() => logger.info('Runtime config updated via dashboard'));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user