Skip to content

Commit

Permalink
Merge pull request #41 from CalPinSW/improve-login-and-edit-playlist-…
Browse files Browse the repository at this point in the history
…page

Improve login and edit playlist page
  • Loading branch information
CalPinSW authored Aug 23, 2024
2 parents ab552a9 + 0703422 commit 58b7372
Show file tree
Hide file tree
Showing 25 changed files with 3,031 additions and 734 deletions.
12 changes: 11 additions & 1 deletion backend/src/controllers/auth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from uuid import uuid4
from flask import Blueprint, make_response, request, session
from flask import Blueprint, make_response, redirect, request, session
from src.flask_config import Config
from src.spotify import SpotifyClient


Expand All @@ -15,6 +16,15 @@ def login():
query_string = spotify.get_login_query_string(state)
return "https://accounts.spotify.com/authorize?" + query_string

@auth_controller.route("logout")
def logout():
resp = make_response("Logged out")
resp.delete_cookie("spotify_access_token")
resp.delete_cookie("spotify_refresh_token")
resp.delete_cookie("user_id")
resp.delete_cookie("session")
return resp

@auth_controller.route("get-user-code")
def auth_redirect():
code = request.args.get("code")
Expand Down
1 change: 1 addition & 0 deletions frontend/build/build-common.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { config } from "dotenv";

config();

const define = {
Expand Down
2 changes: 0 additions & 2 deletions frontend/build/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import * as esbuild from "esbuild";
import { buildOptions } from "./build-common.mjs";
import http from "node:http";

const watchDirectories = ["src/*.{ts,tsx}"];

const runServer = async () => {
const ctx = await esbuild.context(buildOptions);

Expand Down
19 changes: 19 additions & 0 deletions frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";

export default [
{
languageOptions: { globals: {...globals.browser, ...globals.node}, },
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{
rules: {"unused-imports/no-unused-imports": "error"}
},
{
ignores: ["public/bundle.js"],
},
];
Loading

0 comments on commit 58b7372

Please sign in to comment.