feat(slack): use current user to validate connection
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { IGlobalVariable } from '@automatisch/types';
|
import { IGlobalVariable } from '@automatisch/types';
|
||||||
import verifyCredentials from './verify-credentials';
|
import getCurrentUser from '../common/get-current-user';
|
||||||
|
|
||||||
const isStillVerified = async ($: IGlobalVariable) => {
|
const isStillVerified = async ($: IGlobalVariable) => {
|
||||||
try {
|
try {
|
||||||
await verifyCredentials($);
|
const user = await getCurrentUser($);
|
||||||
return true;
|
return !!user.id;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user