Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,918 changes: 2,909 additions & 9 deletions client/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default function App() {
};
const handleSearch = () => {
ApiConnection(userId, handleChangeDataState);

// SendAction(handleChangeDataState, "");
};

Expand Down
4 changes: 3 additions & 1 deletion client/src/components/organisms/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import LogoutButton from "../atoms/LogoutButton";
import Profile from "./Profile";

export default function Header(props: any) {
const [userId, setUserId] = useState(0);
const [userId, setUserId] = useState<number>();
const [navbarOpen, setNavbarOpen] = React.useState(false);
useEffect(() => props.setuserId(userId), [userId, setUserId]);

console.log(userId);

return (
<>
<nav className="relative flex flex-wrap items-center justify-between px-2 py-3 bg-black mb-3 ">
Expand Down
2 changes: 1 addition & 1 deletion server/api/.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"access_token": "BQB-8qRIuSKg_91dY7vvVmlF5F5-BcqdLvYGsVetT5LMsVMpx70Uw6X5m2wqdtBsouc42E2jbX4Ge07mkeE", "token_type": "Bearer", "expires_in": 3600, "expires_at": 1642344004}
{"access_token": "BQDasgKQYm1Wvb5RxfGafPZOBS-1P-rt8JQWze3TSt9FBdmaIWuXjg3wdYYyHAF0rGpba3TfKGLZ3VlrA64", "token_type": "Bearer", "expires_in": 3600, "expires_at": 1642694979}
Binary file removed server/api/__pycache__/auth.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/main.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/schema.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/spotify_connect.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/user_session.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/__pycache__/utils.cpython-38.pyc
Binary file not shown.
Binary file modified server/api/database.sqlite3
Binary file not shown.
4 changes: 3 additions & 1 deletion server/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,17 @@ def private_scoped(response: Response, token: str = Depends(token_auth_scheme)):
this route
"""

print("connect!")

result = VerifyToken(token.credentials, scopes="read:messages").verify()
print(result)

if result.get("status"):
response.status_code = status.HTTP_400_BAD_REQUEST
return result

userId,userName,twitterId,profile_image_url = user_session.init_user_login(result)

user_info = {}
user_info = {"userId":userId,"userName":userName,"twitterId":twitterId,"profileImageUrl":profile_image_url}

return user_info
Expand Down
6 changes: 3 additions & 3 deletions server/api/user_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def init_user_login(result):

# ユーザーIDがユニークではない時INSERTせずROLLBACK

# user = db_session.query(User).\
# filter(User.id==Id).\
# session.rollback()
user = db_session.query(User).\
filter(User.id==Id).\
session.rollback()

db_session.commit()
return userId,userName,twitterId,profileImageUrl