We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Switch EDB to use MAST token from config.json always
Currently the EDB feature of the JWQL web app attempts to authenticate users with whichever MAST token is currently cached (https://github.com/spacetelescope/jwql/blob/develop/jwql/utils/credentials.py#L45), and if that doesn't succeed, _then_ it uses the `mast_token` key in the `config.json` file.  This seems problematic if users are creating new tokens but then attempting to perform EDB queries in the same browser.  We should probably switch this to just use the `mast_token` key in `config.json` file always. 

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `jwql/utils/credentials.py`
Content:
```
1 """Utility functions related to accessing remote services and databases.
2 
3 Authors
4 -------
5 
6     - Johannes Sahlmann
7     - Lauren Chambers
8 
9 Use
10 ---
11 
12     This module can be imported as such:
13     ::
14 
15         import credentials
16         token = credentials.get_mast_token()
17 
18  """
19 import os
20 
21 from astroquery.mast import Mast
22 
23 from jwql.utils.utils import get_config, check_config_for_key
24 
25 
26 def get_mast_token(request=None):
27     """Return MAST token from either Astroquery.Mast, webpage cookies, the
28     JWQL configuration file, or an environment variable.
29 
30     Parameters
31     ----------
32     request : HttpRequest object
33         Incoming request from the webpage
34 
35     Returns
36     -------
37     token : str or None
38         User-specific MAST token string, if available
39     """
40     if Mast.authenticated():
41         print('Authenticated with Astroquery MAST magic')
42         return None
43     else:
44         if request is not None:
45             token = str(request.POST.get('access_token'))
46             if token != 'None':
47                 print('Authenticated with cached MAST token.')
48                 return token
49         try:
50             # check if token is available via config file
51             check_config_for_key('mast_token')
52             token = get_config()['mast_token']
53             print('Authenticated with config.json MAST token.')
54             return token
55         except (KeyError, ValueError):
56             # check if token is available via environment variable
57             # see https://auth.mast.stsci.edu/info
58             try:
59                 token = os.environ['MAST_API_TOKEN']
60                 print('Authenticated with MAST token environment variable.')
61                 return token
62             except KeyError:
63                 return None
64
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/jwql/utils/credentials.py b/jwql/utils/credentials.py
--- a/jwql/utils/credentials.py
+++ b/jwql/utils/credentials.py
@@ -41,11 +41,6 @@
         print('Authenticated with Astroquery MAST magic')
         return None
     else:
-        if request is not None:
-            token = str(request.POST.get('access_token'))
-            if token != 'None':
-                print('Authenticated with cached MAST token.')
-                return token
         try:
             # check if token is available via config file
             check_config_for_key('mast_token')

{"golden_diff": "diff --git a/jwql/utils/credentials.py b/jwql/utils/credentials.py\n--- a/jwql/utils/credentials.py\n+++ b/jwql/utils/credentials.py\n@@ -41,11 +41,6 @@\n         print('Authenticated with Astroquery MAST magic')\n         return None\n     else:\n-        if request is not None:\n-            token = str(request.POST.get('access_token'))\n-            if token != 'None':\n-                print('Authenticated with cached MAST token.')\n-                return token\n         try:\n             # check if token is available via config file\n             check_config_for_key('mast_token')\n", "issue": "Switch EDB to use MAST token from config.json always\nCurrently the EDB feature of the JWQL web app attempts to authenticate users with whichever MAST token is currently cached (https://github.com/spacetelescope/jwql/blob/develop/jwql/utils/credentials.py#L45), and if that doesn't succeed, _then_ it uses the `mast_token` key in the `config.json` file.  This seems problematic if users are creating new tokens but then attempting to perform EDB queries in the same browser.  We should probably switch this to just use the `mast_token` key in `config.json` file always. \n", "before_files": [{"content": "\"\"\"Utility functions related to accessing remote services and databases.\n\nAuthors\n-------\n\n    - Johannes Sahlmann\n    - Lauren Chambers\n\nUse\n---\n\n    This module can be imported as such:\n    ::\n\n        import credentials\n        token = credentials.get_mast_token()\n\n \"\"\"\nimport os\n\nfrom astroquery.mast import Mast\n\nfrom jwql.utils.utils import get_config, check_config_for_key\n\n\ndef get_mast_token(request=None):\n    \"\"\"Return MAST token from either Astroquery.Mast, webpage cookies, the\n    JWQL configuration file, or an environment variable.\n\n    Parameters\n    ----------\n    request : HttpRequest object\n        Incoming request from the webpage\n\n    Returns\n    -------\n    token : str or None\n        User-specific MAST token string, if available\n    \"\"\"\n    if Mast.authenticated():\n        print('Authenticated with Astroquery MAST magic')\n        return None\n    else:\n        if request is not None:\n            token = str(request.POST.get('access_token'))\n            if token != 'None':\n                print('Authenticated with cached MAST token.')\n                return token\n        try:\n            # check if token is available via config file\n            check_config_for_key('mast_token')\n            token = get_config()['mast_token']\n            print('Authenticated with config.json MAST token.')\n            return token\n        except (KeyError, ValueError):\n            # check if token is available via environment variable\n            # see https://auth.mast.stsci.edu/info\n            try:\n                token = os.environ['MAST_API_TOKEN']\n                print('Authenticated with MAST token environment variable.')\n                return token\n            except KeyError:\n                return None\n", "path": "jwql/utils/credentials.py"}], "after_files": [{"content": "\"\"\"Utility functions related to accessing remote services and databases.\n\nAuthors\n-------\n\n    - Johannes Sahlmann\n    - Lauren Chambers\n\nUse\n---\n\n    This module can be imported as such:\n    ::\n\n        import credentials\n        token = credentials.get_mast_token()\n\n \"\"\"\nimport os\n\nfrom astroquery.mast import Mast\n\nfrom jwql.utils.utils import get_config, check_config_for_key\n\n\ndef get_mast_token(request=None):\n    \"\"\"Return MAST token from either Astroquery.Mast, webpage cookies, the\n    JWQL configuration file, or an environment variable.\n\n    Parameters\n    ----------\n    request : HttpRequest object\n        Incoming request from the webpage\n\n    Returns\n    -------\n    token : str or None\n        User-specific MAST token string, if available\n    \"\"\"\n    if Mast.authenticated():\n        print('Authenticated with Astroquery MAST magic')\n        return None\n    else:\n        try:\n            # check if token is available via config file\n            check_config_for_key('mast_token')\n            token = get_config()['mast_token']\n            print('Authenticated with config.json MAST token.')\n            return token\n        except (KeyError, ValueError):\n            # check if token is available via environment variable\n            # see https://auth.mast.stsci.edu/info\n            try:\n                token = os.environ['MAST_API_TOKEN']\n                print('Authenticated with MAST token environment variable.')\n                return token\n            except KeyError:\n                return None\n", "path": "jwql/utils/credentials.py"}]}