It doesn't ask me for Spotify credentials when I want to log in again

26 Views Asked by At

When I logout I log in, the problem is that when I log in again it doesn't ask me for the Spotify credentials, for my login I use the Spotify API and call the authorized one.

I have tried putting the session so I can delete the token but it still doesn't work either.

I have the following:

@app.route('/')
def index():
    return render_template('index.html')

@app.route("/login")
def login():
    auth_url = sp_oauth.get_authorize_url() 
    return redirect(auth_url)
@app.route("/logout")
def logout():
    session.pop("token_info",None) 
    session.clear()
    return redirect("/")
@app.route("/callback")
def callback():
    token_info = sp_oauth.get_access_token(request.args["code"])
    session["token_info"] = token_info
    return redirect("/dashboard")  
@app.route('/dashboard', methods=['GET','POST'])
def dashboard():
    #Here my intention is to retrieve the token and create a spotify object to be able to make API calls to the user in question.
0

There are 0 best solutions below