feat(slack): use current user to validate connection

This commit is contained in:
Ali BARIN
2022-11-02 20:22:14 +01:00
parent dbcf8fde7f
commit e740d4fe25

View File

@@ -1,10 +1,10 @@
import { IGlobalVariable } from '@automatisch/types';
import verifyCredentials from './verify-credentials';
import getCurrentUser from '../common/get-current-user';
const isStillVerified = async ($: IGlobalVariable) => {
try {
await verifyCredentials($);
return true;
const user = await getCurrentUser($);
return !!user.id;
} catch (error) {
return false;
}