From a5b3c72dec0202fb92d9da4a3e1af826c7328647 Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Mon, 23 Jan 2023 23:19:01 +0000 Subject: [PATCH] added spotify auth callback --- .../pages/callbacks/sync/spotify/index.jsx | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/app/src/pages/callbacks/sync/spotify/index.jsx diff --git a/packages/app/src/pages/callbacks/sync/spotify/index.jsx b/packages/app/src/pages/callbacks/sync/spotify/index.jsx new file mode 100644 index 00000000..0e5ba06d --- /dev/null +++ b/packages/app/src/pages/callbacks/sync/spotify/index.jsx @@ -0,0 +1,35 @@ +import React from "react" + +import * as antd from "antd" + +import SyncModel from "models/sync" + +export default (props) => { + const [error, setError] = React.useState(null) + + const makeSync = async () => { + const result = await SyncModel.spotifyCore.syncAuthCode(window.location.search.split("=")[1]).catch((err) => { + setError(err.message) + + return false + }) + + if (result) { + window.close() + } + } + + React.useEffect(() => { + makeSync() + }, []) + + if (error) { + return + } + + return

Please wait meanwhile we are syncing your Spotify account

+} \ No newline at end of file