Skip to content
Sign upLog in
← Back to Community

How to repl auth logout

Profile icon
matthewproskils

I saw the python tutorial mat posted, but i don't know how to clear the user_id, user_name, etc. input. I tried writing user_id = None, but it apparentaly didn't work. Any help?

Voters
Profile icon
BirgitPi
Profile icon
DollarSign
Profile icon
matthewproskils
Comments
hotnewtop
Profile icon
PhillipConrad

I'm still trying to figure this out as well. Another forum post suggested that clearing the REPL_AUTH cookie would make the user logged out, but that didn't work for me:

@app.route("/") @web.authenticated def index(): print("web.auth=",web.auth) hits = users.current.get("hits", 0) + 1 users.current["hits"] = hits return f''' <h1>Welcome {web.auth.name} 1</h1> <p>You have visited this page {hits} times<p> ''' @app.route("/logout") @web.authenticated def logout(): resp = make_response("You are logged out") # ^^^ EXCEPT IT DOESN'T WORK :-( resp.set_cookie('REPL_AUTH', expires=0) return resp;
Profile icon
PhillipConrad
Profile icon
DollarSign

What Client are you using? (EG HTML, PHP etc)

Profile icon
matthewproskils

@DollarSign
Html w/ python

Profile icon
matthewproskils

@matthewproskils
and do people use local storage for user id and stuff to save

Profile icon
DollarSign

Can you give me the link to the repl, maybe i can fork it and see whats wrong.

@matthewproskils

Profile icon
matthewproskils

@DollarSign
https://repl.it/@matthewproskils/AlertSurprisedEmulation#templates/login.html

Profile icon
matthewproskils

@matthewproskils
I'm just testing some stuff

Profile icon
DollarSign

@matthewproskils
I couldnt do anything, maybe you should use Google AuthO

EDIT: Redirect to login.html using meta updates, not []

Profile icon
matthewproskils

@DollarSign
ok