mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 20:12:24 -06:00
[chore]: Bump github.com/gorilla/websocket from 1.5.0 to 1.5.1 (#2335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
33ee61575f
commit
2eb8b8eeb4
29 changed files with 1203 additions and 632 deletions
|
|
@ -162,24 +162,27 @@ func (m *Module) StreamGETHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
if token != "" {
|
||||
|
||||
// Token was provided, use it to authorize stream.
|
||||
account, errWithCode = m.processor.Stream().Authorize(c.Request.Context(), token)
|
||||
if errWithCode != nil {
|
||||
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
|
||||
return
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// No explicit token was provided:
|
||||
// try regular oauth as a last resort.
|
||||
account, errWithCode = func() (*gtsmodel.Account, gtserror.WithCode) {
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
if err != nil {
|
||||
return nil, gtserror.NewErrorUnauthorized(err, err.Error())
|
||||
}
|
||||
authed, err := oauth.Authed(c, true, true, true, true)
|
||||
if err != nil {
|
||||
errWithCode := gtserror.NewErrorUnauthorized(err, err.Error())
|
||||
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
|
||||
return
|
||||
}
|
||||
|
||||
return authed.Account, nil
|
||||
}()
|
||||
}
|
||||
|
||||
if errWithCode != nil {
|
||||
apiutil.ErrorHandler(c, errWithCode, m.processor.InstanceGetV1)
|
||||
return
|
||||
// Set the auth'ed account.
|
||||
account = authed.Account
|
||||
}
|
||||
|
||||
// Get the initial requested stream type, if there is one.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue