Skip to content

Commit

Permalink
Try double throwing redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
cephalization committed Sep 19, 2024
1 parent f48efd2 commit 857b3f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/lib/auth.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const getAuth = async (
const refresh = async () => {
const r = await refreshAuth(auth.refresh_token);
session.set("auth", r);
throw redirect(request.url, { status: 302 });
throw redirect(request.url);
};
return {
auth,
Expand Down
11 changes: 8 additions & 3 deletions app/lib/spotify.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ export class SpotifyClient {
}

async getPlaylist(id: string) {
return playlistResponseSchema.parse(
await this.request(`https://api.spotify.com/v1/playlists/${id}`),
);
try {
const r = await this.request(
`https://api.spotify.com/v1/playlists/${id}`,
);
return playlistResponseSchema.parse(r);
} catch (e) {
throw e;
}
}

async getPlaylistTracks(id: string) {
Expand Down

0 comments on commit 857b3f4

Please sign in to comment.