fix redirect loop
This commit is contained in:
@@ -2,13 +2,13 @@ class SpotifyController < ApplicationController
|
|||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
|
||||||
def index
|
def index
|
||||||
# If already connected, redirect to dashboard
|
# If already connected and alive, redirect to dashboard
|
||||||
redirect_to statistics_path if current_user.logins.exists?(platform: "spotify")
|
redirect_to statistics_path if current_user.logins.alive.exists?(platform: "spotify")
|
||||||
end
|
end
|
||||||
|
|
||||||
def connect
|
def connect
|
||||||
# If user already has a login, redirect to statistics dashboard
|
# If user already has an alive login, redirect to statistics dashboard
|
||||||
return redirect_to statistics_path if current_user.logins.exists?(platform: "spotify")
|
return redirect_to statistics_path if current_user.logins.alive.exists?(platform: "spotify")
|
||||||
client_id = ENV["SPOTIFY_CLIENT_ID"]
|
client_id = ENV["SPOTIFY_CLIENT_ID"]
|
||||||
redirect_uri = SpotifyClient::SPOTIFY_REDIRECT_URI
|
redirect_uri = SpotifyClient::SPOTIFY_REDIRECT_URI
|
||||||
scope = SpotifyClient::SCOPE
|
scope = SpotifyClient::SCOPE
|
||||||
|
|||||||
Reference in New Issue
Block a user