Skip to content

Commit

Permalink
Merge pull request #7 from mattermost/remove_unneeded_code
Browse files Browse the repository at this point in the history
Remove AuthZ header from server validation
  • Loading branch information
esarafianou authored Sep 16, 2024
2 parents 5865f4e + 98cef36 commit a4ea753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ export class FetchError extends Error {
}
}

export const validateServerURL = async (mattermostServerURL: string, authToken: string) => {
export const validateServerURL = async (mattermostServerURL: string) => {
try {
let response = await fetch(
`${mattermostServerURL}/plugins/playbooks/tabapp/runs`,
{
method: 'OPTIONS',
headers: {
"Authorization": authToken,
},
method: 'OPTIONS'
}
);

Expand Down
4 changes: 1 addition & 3 deletions src/components/Setup.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import MattermostLogo from './mattermost_logo.svg';
import { getAuthToken } from './auth';
import { validateServerURL } from '../client';

const styles = {
Expand Down Expand Up @@ -83,8 +82,7 @@ export default function Setup() {
return
}

const token = await getAuthToken()
const valid = await validateServerURL(url, token)
const valid = await validateServerURL(url)
if (!valid) {
setErrorText("This server does not appear to be configured for integration with MS Teams. Contact your system administrator.");
return
Expand Down

0 comments on commit a4ea753

Please sign in to comment.