diff --git a/404.html b/404.html index 473eddee13..34da28c3f7 100644 --- a/404.html +++ b/404.html @@ -14,7 +14,7 @@ - + @@ -22,7 +22,7 @@ - + @@ -589,6 +589,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -737,7 +757,7 @@

    404 - Not found

    - + diff --git a/About/index.html b/About/index.html index 9e8e6ed32e..3d4f1322a2 100644 --- a/About/index.html +++ b/About/index.html @@ -18,7 +18,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -656,6 +656,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -898,7 +918,7 @@

    Info for developers{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/CODE_OF_CONDUCT/index.html b/CODE_OF_CONDUCT/index.html index 80b04bee23..5eac76337a 100644 --- a/CODE_OF_CONDUCT/index.html +++ b/CODE_OF_CONDUCT/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -651,6 +651,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -940,7 +960,7 @@

    Complaint Handling Process{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/CONTRIBUTING/index.html b/CONTRIBUTING/index.html index 35cec9f97b..5799cab634 100644 --- a/CONTRIBUTING/index.html +++ b/CONTRIBUTING/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -722,6 +722,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -1047,7 +1067,7 @@

    Coding Style{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/FAQ/index.html b/FAQ/index.html index bed445c0fd..acfbce7091 100644 --- a/FAQ/index.html +++ b/FAQ/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -667,6 +667,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -1028,7 +1048,7 @@

    For Contributors{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/Guide-On-Improving-Documentation/index.html b/Guide-On-Improving-Documentation/index.html index 08146d13f4..02efbf6aae 100644 --- a/Guide-On-Improving-Documentation/index.html +++ b/Guide-On-Improving-Documentation/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -706,6 +706,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -1080,7 +1100,7 @@

    Improving Existing Documentation{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/INSTALL/index.html b/INSTALL/index.html index 1b65aeefbd..0a37be679a 100644 --- a/INSTALL/index.html +++ b/INSTALL/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -612,6 +612,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -696,7 +716,7 @@
    -

    NOTE: This is an installation guide to quickly get the fmtm app up and running. For a detailed guide on how to install the fmtm app using different methods and contributing, checkout the docs

    +

    NOTE: This is an installation guide to quickly get the fmtm app up and running. For a detailed guide on how to install the fmtm app using different methods and contributing, checkout the dev docs

    Table of Contents

      @@ -906,9 +926,6 @@

      Starting the Frontend ContainersMap: http://127.0.0.1:8081

    That's it, you have successfully set up the frontend!!

    -
    -

    NOTE: For a detailed guide, installation tips and other installation methods, check out the docs folder

    -
    @@ -986,7 +1003,7 @@

    Starting the Frontend Containers{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/User-Manual-For-Project-Managers/index.html b/User-Manual-For-Project-Managers/index.html index 385e966d9d..72e26290f6 100644 --- a/User-Manual-For-Project-Managers/index.html +++ b/User-Manual-For-Project-Managers/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -700,6 +700,26 @@ + + + + + +
  • + + + + + Troubleshooting + + + + +
  • + + + + @@ -1106,7 +1126,7 @@

    Thank you{"base": "..", "features": [], "search": "../assets/javascripts/workers/search.dfff1995.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}} - + diff --git a/apidocs/html/auth__routes_8py_source.html b/apidocs/html/auth__routes_8py_source.html index e897905e8e..8c0442ff0f 100644 --- a/apidocs/html/auth__routes_8py_source.html +++ b/apidocs/html/auth__routes_8py_source.html @@ -94,82 +94,86 @@
    22from fastapi import APIRouter, Depends, HTTPException, Request
    23from fastapi.responses import JSONResponse
    24from sqlalchemy.orm import Session
    -
    25
    -
    26from ..db import database
    -
    27from ..db.db_models import DbUser
    -
    28from ..users import user_crud
    -
    29from .osm import AuthUser, init_osm_auth, login_required
    -
    30
    -
    31router = APIRouter(
    -
    32 prefix="/auth",
    -
    33 tags=["auth"],
    -
    34 responses={404: {"description": "Not found"}},
    -
    35)
    -
    36
    -
    37
    -
    38@router.get("/osm_login/")
    -
    39def login_url(request: Request, osm_auth=Depends(init_osm_auth)):
    -
    40 """Generate Login URL for authentication using OAuth2 Application registered with OpenStreetMap.
    -
    41 Click on the download url returned to get access_token.
    -
    42
    -
    43 Parameters: None
    -
    44
    -
    45 Returns:
    -
    46 -------
    -
    47 - login_url (string) - URL to authorize user to the application via. Openstreetmap
    -
    48 OAuth2 with client_id, redirect_uri, and permission scope as query_string parameters
    -
    49 """
    -
    50 login_url = osm_auth.login()
    -
    51 log.debug(f"Login URL returned: {login_url}")
    -
    52 return JSONResponse(content=login_url, status_code=200)
    -
    53
    -
    54
    -
    55@router.get("/callback/")
    -
    56def callback(request: Request, osm_auth=Depends(init_osm_auth)):
    -
    57 """Performs token exchange between OpenStreetMap and Export tool API.
    -
    58
    -
    59 Core will use Oauth secret key from configuration while deserializing token,
    -
    60 provides access token that can be used for authorized endpoints.
    -
    61
    -
    62 Parameters: None
    +
    25from ..config import settings
    +
    26
    +
    27
    +
    28from ..db import database
    +
    29from ..db.db_models import DbUser
    +
    30from ..users import user_crud
    +
    31from .osm import AuthUser, init_osm_auth, login_required
    +
    32
    +
    33router = APIRouter(
    +
    34 prefix="/auth",
    +
    35 tags=["auth"],
    +
    36 responses={404: {"description": "Not found"}},
    +
    37)
    +
    38
    +
    39
    +
    40@router.get("/osm_login/")
    +
    41def login_url(request: Request, osm_auth=Depends(init_osm_auth)):
    +
    42 """Generate Login URL for authentication using OAuth2 Application registered with OpenStreetMap.
    +
    43 Click on the download url returned to get access_token.
    +
    44
    +
    45 Parameters: None
    +
    46
    +
    47 Returns:
    +
    48 -------
    +
    49 - login_url (string) - URL to authorize user to the application via. Openstreetmap
    +
    50 OAuth2 with client_id, redirect_uri, and permission scope as query_string parameters
    +
    51 """
    +
    52 login_url = osm_auth.login()
    +
    53 log.debug(f"Login URL returned: {login_url}")
    +
    54 return JSONResponse(content=login_url, status_code=200)
    +
    55
    +
    56
    +
    57@router.get("/callback/")
    +
    58def callback(request: Request, osm_auth=Depends(init_osm_auth)):
    +
    59 """Performs token exchange between OpenStreetMap and Export tool API.
    +
    60
    +
    61 Core will use Oauth secret key from configuration while deserializing token,
    +
    62 provides access token that can be used for authorized endpoints.
    63
    -
    64 Returns:
    -
    65 -------
    -
    66 - access_token (string)
    -
    67 """
    -
    68 access_token = osm_auth.callback(str(request.url))
    -
    69 log.debug(f"Access token returned: {access_token}")
    -
    70 return JSONResponse(content={"access_token": access_token}, status_code=200)
    -
    71
    -
    72
    -
    73@router.get("/me/", response_model=AuthUser)
    -
    74def my_data(
    -
    75 db: Session = Depends(database.get_db),
    -
    76 user_data: AuthUser = Depends(login_required),
    -
    77):
    -
    78 """Read the access token and provide user details from OSM user's API endpoint,
    -
    79 also integrated with underpass .
    -
    80
    -
    81 Parameters:None
    -
    82
    -
    83 Returns: user_data
    -
    84 """
    -
    85 # Save user info in User table
    -
    86 user = user_crud.get_user_by_id(db, user_data["id"])
    -
    87 if not user:
    -
    88 user_by_username = user_crud.get_user_by_username(db, user_data["username"])
    -
    89 if user_by_username:
    -
    90 raise HTTPException(
    -
    91 status_code=400,
    -
    92 detail=f"User with this username {user_data['username']} already exists. \
    -
    93 Please contact the administrator for this.",
    -
    94 )
    -
    95
    -
    96 db_user = DbUser(id=user_data["id"], username=user_data["username"])
    -
    97 db.add(db_user)
    -
    98 db.commit()
    +
    64 Parameters: None
    +
    65
    +
    66 Returns:
    +
    67 -------
    +
    68 - access_token (string)
    +
    69 """
    +
    70 print("Call back api requested", request.url)
    +
    71
    +
    72 access_token = osm_auth.callback(str(request.url).replace('http',settings.URL_SCHEME))
    +
    73 log.debug(f"Access token returned: {access_token}")
    +
    74 return JSONResponse(content={"access_token": access_token}, status_code=200)
    +
    75
    +
    76
    +
    77@router.get("/me/", response_model=AuthUser)
    +
    78def my_data(
    +
    79 db: Session = Depends(database.get_db),
    +
    80 user_data: AuthUser = Depends(login_required),
    +
    81):
    +
    82 """Read the access token and provide user details from OSM user's API endpoint,
    +
    83 also integrated with underpass .
    +
    84
    +
    85 Parameters:None
    +
    86
    +
    87 Returns: user_data
    +
    88 """
    +
    89 # Save user info in User table
    +
    90 user = user_crud.get_user_by_id(db, user_data["id"])
    +
    91 if not user:
    +
    92 user_by_username = user_crud.get_user_by_username(db, user_data["username"])
    +
    93 if user_by_username:
    +
    94 raise HTTPException(
    +
    95 status_code=400,
    +
    96 detail=f"User with this username {user_data['username']} already exists. \
    +
    97 Please contact the administrator for this.",
    +
    98 )
    99
    -
    100 return JSONResponse(content={"user_data": user_data}, status_code=200)
    +
    100 db_user = DbUser(id=user_data["id"], username=user_data["username"])
    +
    101 db.add(db_user)
    +
    102 db.commit()
    +
    103
    +
    104 return JSONResponse(content={"user_data": user_data}, status_code=200)