prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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. 
  
  </issue>
  <code>
  [start of jwql/utils/credentials.py]
  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 of jwql/utils/credentials.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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')
  
verification_info: {"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"}]}