feat: Convert all app files to JS
This commit is contained in:
15
packages/backend/src/apps/odoo/auth/verify-credentials.js
Normal file
15
packages/backend/src/apps/odoo/auth/verify-credentials.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { authenticate } from '../common/xmlrpc-client.js';
|
||||
|
||||
const verifyCredentials = async ($) => {
|
||||
try {
|
||||
await authenticate($);
|
||||
|
||||
await $.auth.set({
|
||||
screenName: `${$.auth.data.email} @ ${$.auth.data.databaseName} - ${$.auth.data.host}`,
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error('Failed while authorizing!');
|
||||
}
|
||||
};
|
||||
|
||||
export default verifyCredentials;
|
Reference in New Issue
Block a user