Skip to content

Commit

Permalink
Restore defer
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltallent committed Dec 19, 2019
1 parent d41ae8a commit b1b23dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gothic/gothic.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ as either "provider" or ":provider".
See https://github.com/markbates/goth/examples/main.go to see this in action.
*/
var CompleteUserAuth = func(res http.ResponseWriter, req *http.Request) (goth.User, error) {
defer Logout(res, req)
if !keySet && defaultStore == Store {
fmt.Println("goth/gothic: no SESSION_SECRET environment variable is set. The default cookie store is not available and any calls will fail. Ignore this warning if you are using a different store.")
}
Expand All @@ -167,7 +168,7 @@ var CompleteUserAuth = func(res http.ResponseWriter, req *http.Request) (goth.Us
if err != nil {
return goth.User{}, err
}
defer Logout(res, req)

sess, err := provider.UnmarshalSession(value)
if err != nil {
return goth.User{}, err
Expand Down

0 comments on commit b1b23dd

Please sign in to comment.