markbates / markbates/goth

Problem logging out

Open
#433 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.6k
Forks
631
PR merge metrics
No merged PRs in 30d

Description

Hello:

Perhaps I'm not understanding things correctly, but I'm not certain that logout is working the way that I think it does.
I have no problem logging in (I'm testing things using GitHub), and I understand that goth's cookie only exists long enough to handle the authentication through GitHub, but when I log a user out like this:

`gothic.Logout(w, r)`

The user does not actually appear to be logged out of GitHub. The token still exists on GitHub as an authenticated user, and if I click on my login button again, which calls this hander:
~~~
func (s *SocialLogin) GithubLogin(w http.ResponseWriter, r *http.Request) {
s.InitSocialAuth(r)
if _, err := gothic.CompleteUserAuth(w, r); err == nil {
http.Redirect(w, r, "/", http.StatusSeeOther)
} else {
gothic.BeginAuthHandler(w, r)
}
}
~~~
the user is instantly logged in, without having to enter GitHub credentials.
I assume that I need to save something that is returned by the call to `gothic.CompleteUserAuth`, but I'm not sure what...
How, exactly, do I instruct GitHub to log the user out properly?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported flow through gothic.Logout, CompleteUserAuth, BeginAuthHandler, and the GithubLogin handler. Determine the expected relationship between local logout and the authenticated GitHub session, then verify the behavior when the login flow is started again and document or resolve the observed result.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, go
Domain
authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.