Build frontend & fixed oauth scopes #162

This commit is contained in:
Sven Heidemann 2023-02-09 14:30:51 +01:00
parent eaa22efd08
commit 8273b2b98e
5 changed files with 8 additions and 10 deletions

View File

@ -26,7 +26,7 @@
"PyJWT==2.6.0", "PyJWT==2.6.0",
"waitress==2.1.2", "waitress==2.1.2",
"Flask-SocketIO==5.3.2", "Flask-SocketIO==5.3.2",
"eventlet==0.33.2", "eventlet==0.33.3",
"requests-oauthlib==1.3.1", "requests-oauthlib==1.3.1",
"icmplib==3.0.3", "icmplib==3.0.3",
"ariadne==0.17.1" "ariadne==0.17.1"

@ -1 +1 @@
Subproject commit e6046881b562982008583afa973b39ff08b6a3c7 Subproject commit 27289afd5e2d020cd9fcec62a682204a93688f25

View File

@ -8,7 +8,7 @@ from cpl_core.utils import CredentialManager
from cpl_discord.service import DiscordBotServiceABC from cpl_discord.service import DiscordBotServiceABC
from cpl_translation import TranslatePipe from cpl_translation import TranslatePipe
from flask import jsonify, Response from flask import jsonify, Response
from flask import request, session from flask import request
from requests_oauthlib import OAuth2Session from requests_oauthlib import OAuth2Session
from bot_api.abc.auth_service_abc import AuthServiceABC from bot_api.abc.auth_service_abc import AuthServiceABC
@ -16,10 +16,8 @@ from bot_api.api import Api
from bot_api.configuration.discord_authentication_settings import ( from bot_api.configuration.discord_authentication_settings import (
DiscordAuthenticationSettings, DiscordAuthenticationSettings,
) )
from bot_api.json_processor import JSONProcessor
from bot_api.logging.api_logger import ApiLogger from bot_api.logging.api_logger import ApiLogger
from bot_api.model.auth_user_dto import AuthUserDTO from bot_api.model.auth_user_dto import AuthUserDTO
from bot_api.model.o_auth_dto import OAuthDTO
from bot_api.route.route import Route from bot_api.route.route import Route
from bot_data.model.auth_role_enum import AuthRoleEnum from bot_data.model.auth_role_enum import AuthRoleEnum
@ -59,7 +57,7 @@ class AuthDiscordController:
self._bot.user.id, self._bot.user.id,
redirect_uri=self._auth_settings.redirect_url, redirect_uri=self._auth_settings.redirect_url,
state=request.args.get("state"), state=request.args.get("state"),
scope=self._auth_settings.scope, scope=self._auth_settings.scope.to_list(),
) )
token = discord.fetch_token( token = discord.fetch_token(
self._auth_settings.token_url, self._auth_settings.token_url,
@ -74,7 +72,7 @@ class AuthDiscordController:
oauth = OAuth2Session( oauth = OAuth2Session(
self._bot.user.id, self._bot.user.id,
redirect_uri=self._auth_settings.redirect_url, redirect_uri=self._auth_settings.redirect_url,
scope=self._auth_settings.scope, scope=self._auth_settings.scope.to_list(),
) )
login_url, state = oauth.authorization_url(self._auth_settings.auth_url) login_url, state = oauth.authorization_url(self._auth_settings.auth_url)
return jsonify({"loginUrl": login_url}) return jsonify({"loginUrl": login_url})

View File

@ -1,6 +1,6 @@
{ {
"name": "kdb-web", "name": "kdb-web",
"version": "0.3.0", "version": "0.3.dev162",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"update-version": "ts-node-esm update-version.ts", "update-version": "ts-node-esm update-version.ts",

View File

@ -3,7 +3,7 @@
"WebVersion": { "WebVersion": {
"Major": "0", "Major": "0",
"Minor": "3", "Minor": "3",
"Micro": "0" "Micro": "dev162"
}, },
"Themes": [ "Themes": [
{ {