Skip to content

Commit a6f43c5

Browse files
committed
Update
Signed-off-by: raj-subhankar <subhankar.rj@gmail.com>
1 parent 9336b80 commit a6f43c5

1 file changed

Lines changed: 32 additions & 36 deletions

File tree

ui/desktop/src/tetrateAuth.ts

Lines changed: 32 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,39 @@ function loadNativeAuthSession(): NativeAuthSession | null {
5050

5151
const require = createRequire(import.meta.url);
5252
const appPath = app.getAppPath();
53-
const candidates = app.isPackaged
54-
? [
55-
path.join(
56-
process.resourcesPath,
57-
'native',
58-
'auth_session',
59-
'build',
60-
'Release',
61-
'auth_session.node'
62-
),
63-
path.join(process.resourcesPath, 'auth_session.node'),
64-
path.join(process.resourcesPath, 'native', 'auth_session.node'),
65-
]
66-
: [
67-
path.join(
68-
appPath,
69-
'src',
70-
'native',
71-
'auth_session',
72-
'build',
73-
'Release',
74-
'auth_session.node'
75-
),
76-
path.join(appPath, 'src', 'native', 'auth_session.node'),
77-
];
78-
79-
for (const candidate of candidates) {
80-
if (!fsSync.existsSync(candidate)) {
81-
continue;
82-
}
53+
const candidate = app.isPackaged
54+
? path.join(
55+
process.resourcesPath,
56+
'native',
57+
'auth_session',
58+
'build',
59+
'Release',
60+
'auth_session.node'
61+
)
62+
: path.join(
63+
appPath,
64+
'src',
65+
'native',
66+
'auth_session',
67+
'build',
68+
'Release',
69+
'auth_session.node'
70+
);
71+
72+
if (!fsSync.existsSync(candidate)) {
73+
log.info('Tetrate auth native module not found:', candidate);
74+
nativeAuthSession = null;
75+
return null;
76+
}
8377

84-
try {
85-
nativeAuthSession = require(candidate) as NativeAuthSession;
86-
return nativeAuthSession;
87-
} catch {
88-
continue;
89-
}
78+
try {
79+
nativeAuthSession = require(candidate) as NativeAuthSession;
80+
return nativeAuthSession;
81+
} catch (error) {
82+
log.info(
83+
'Tetrate auth native module failed to load:',
84+
error instanceof Error ? error.message : String(error)
85+
);
9086
}
9187

9288
nativeAuthSession = null;

0 commit comments

Comments
 (0)