我可以从Oauth登录的用户发布到Twitter吗?

Currently have a web app that logs in a user (and saves them to the DB) through Oauthing with twitter.

You can also tweet from the webapp, however the tweet is currently coded to be sent from a hardcoded AccessToken (Gotten from the developers dashboard) and not the previously signed in user.

How do i access the access token generated when logging in, so that they can then send a tweet from that account? Or is there another method.

Every single piece of code i find involves tweeting from the developers account, and not logging in through Oauth and then tweeting.

I am currently using Golang buffalo framework, with Goth (for the auth) and dghubble's go-twitter (for the tweet) libraries.

Here is the code for the auth:

func init() {
    gothic.Store = App().SessionStore

    goth.UseProviders(
        twitter.New(os.Getenv("API_KEY"), os.Getenv("API_SECRET"), fmt.Sprintf("%s%s", App().Host, "/auth/twitter/callback")),
    )
}

func AuthCallback(c buffalo.Context) error {
    gu, err := gothic.CompleteUserAuth(c.Response(), c.Request())
    if err != nil {
        return c.Error(401, err)
    }
    tx := c.Value("tx").(*pop.Connection)
    q := tx.Where("provider = ? and provider_id = ?", gu.Provider, gu.UserID)
    exists, err := q.Exists("users")
    if err != nil {
        return errors.WithStack(err)
    }
    u := &models.User{}
    if exists {
        if err = q.First(u); err != nil {
            return errors.WithStack(err)
        }
    }
    u.Name = defaults.String(gu.Name, gu.NickName)
    u.Provider = gu.Provider
    u.ProviderID = gu.UserID
    u.Email = nulls.NewString(gu.Email)
    if err = tx.Save(u); err != nil {
        return errors.WithStack(err)
    }

    c.Session().Set("current_user_id", u.ID)
    if err = c.Session().Save(); err != nil {
        return errors.WithStack(err)
    }

    c.Flash().Add("success", "You have been logged in")
    return c.Redirect(302, "/")
}

func AuthDestroy(c buffalo.Context) error {
    c.Session().Clear()
    c.Flash().Add("success", "You have been logged out")
    return c.Redirect(302, "/")
}

func SetCurrentUser(next buffalo.Handler) buffalo.Handler {
    return func(c buffalo.Context) error {
        if uid := c.Session().Get("current_user_id"); uid != nil {
            u := &models.User{}
            tx := c.Value("tx").(*pop.Connection)
            if err := tx.Find(u, uid); err != nil {
                return errors.WithStack(err)
            }
            c.Set("current_user", u)
        }
        return next(c)
    }
}

func Authorize(next buffalo.Handler) buffalo.Handler {
    return func(c buffalo.Context) error {
        if uid := c.Session().Get("current_user_id"); uid == nil {
            c.Flash().Add("danger", "You must be authorized to see that page")
            return c.Redirect(302, "/")
        }
        return next(c)
    }
}

And here is the code that handles the tweet:

GetClient sets up the client ready to send the tweet.

type Credentials struct {
    APIKey            string
    APISecret         string
    AccessToken       string
    AccessTokenSecret string
}

// getClient is a helper function that will return a twitter client
// that we can subsequently use to send tweets, or to stream new tweets
// this will take in a pointer to a Credential struct which will contain
// everything needed to authenticate and return a pointer to a twitter Client
// or an error
func GetClient(creds *Credentials) (*twitter.Client, error) {
    // Pass in your consumer key (API Key) and your Consumer Secret (API Secret)
    config := oauth1.NewConfig(creds.APIKey, creds.APISecret)
    // Pass in your Access Token and your Access Token Secret
    token := oauth1.NewToken(creds.AccessToken, creds.AccessTokenSecret)

    httpClient := config.Client(oauth1.NoContext, token)
    client := twitter.NewClient(httpClient)

    // Verify Credentials
    verifyParams := &twitter.AccountVerifyParams{
        SkipStatus:   twitter.Bool(true),
        IncludeEmail: twitter.Bool(true),
    }

    // we can retrieve the user and verify if the credentials
    // we have used successfully allow us to log in!
    user, _, err := client.Accounts.VerifyCredentials(verifyParams)
    if err != nil {
        return nil, err
    }

    log.Printf("User's ACCOUNT:
%+v
", user)
    return client, nil
}

This sends the tweet:

func SendHandler(c buffalo.Context) error {

    //Calls http.Request package to get the form values. Assigns it to Req
    Req := c.Request()
    //ParseForm decodes the form
    Req.ParseForm()

    //Gets the value from the form, assigns it to body.
    body := Req.FormValue("tweetbody")

    fmt.Printf("%+v
", creds)

    //Gets the client from the twitter package
    client, err := twitter.GetClient(&creds)
    if err != nil {
        log.Println("Error getting Twitter Client")
        log.Println(err)
    }

    //Sending the actual tweet. Body from the form
    tweet, resp, err := client.Statuses.Update(body, nil)
    if err != nil {
        log.Println(err)
    }
    log.Printf("%+v
", resp)
    log.Printf("%+v
", tweet)
    return c.Redirect(302, "/tweet/confirm")

}

Im only assuming I have to get the access token from the oauth... If there is a better way please state it.