diff --git a/webapp/titanembeds/blueprints/api/api.py b/webapp/titanembeds/blueprints/api/api.py index 1d3789a..5439061 100644 --- a/webapp/titanembeds/blueprints/api/api.py +++ b/webapp/titanembeds/blueprints/api/api.py @@ -388,7 +388,9 @@ def create_authenticated_user(): abort(404) if not checkUserBanned(guild_id): if not check_user_in_guild(guild_id): - discord_api.add_guild_member(guild_id, session['user_id'], session['user_keys']['access_token']) + add_member = discord_api.add_guild_member(guild_id, session['user_id'], session['user_keys']['access_token']) + if not add_member["success"]: + abort(403) db_user = db.session.query(AuthenticatedUsers).filter(and_(AuthenticatedUsers.guild_id == guild_id, AuthenticatedUsers.client_id == session['user_id'])).first() if not db_user: db_user = AuthenticatedUsers(guild_id, session['user_id'])