fix(auth): unify imported sessions with account gating
This commit is contained in:
1 parent
654bbda457
commit
ea92a1a92b
15 files changed
+123
-49
No files matched your search
+4
-1
@@ -77,6 +77,7 @@ export async function runMainLoop(app: AppContainer): Promise<void> {
|
||||
config,
|
||||
logger,
|
||||
browserClient,
|
||||
accountAuth,
|
||||
postsRepo,
|
||||
messagesRepo,
|
||||
redditApi,
|
||||
@@ -177,7 +178,9 @@ export async function runMainLoop(app: AppContainer): Promise<void> {
|
||||
|
||||
while (!isShuttingDown) {
|
||||
try {
|
||||
if (!sessionRuntime.reconcile(browserClient.getSessionState())) {
|
||||
const authenticated = accountAuth.isFullyAuthenticated()
|
||||
|| await accountAuth.ensureFullyAuthenticated();
|
||||
if (!sessionRuntime.reconcile(authenticated)) {
|
||||
if (Date.now() - lastPausedLog > PAUSED_LOG_INTERVAL_MS) {
|
||||
logger.info('Reddit is logged out. Waiting for a session dump from the extension.');
|
||||
lastPausedLog = Date.now();
|
||||
|
||||
Reference in new issue
Block a user