mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 09:22:25 -05:00
groundwork for other account routes
This commit is contained in:
parent
0ea69345b9
commit
26c482cd86
9 changed files with 186 additions and 65 deletions
|
|
@ -216,10 +216,19 @@ func (suite *AccountTestSuite) TestAPIInitialize() {
|
|||
}
|
||||
|
||||
r.AttachMiddleware(func(c *gin.Context) {
|
||||
account := &model.Account{}
|
||||
if err := suite.db.GetAccountByUserID(suite.testUser.ID, account); err != nil || account == nil {
|
||||
suite.T().Log(err)
|
||||
suite.FailNowf("no account found for user %s, continuing with unauthenticated request: %+v", "", suite.testUser.ID, account)
|
||||
fmt.Println(account)
|
||||
return
|
||||
}
|
||||
|
||||
c.Set(oauth.SessionAuthorizedAccount, account)
|
||||
c.Set(oauth.SessionAuthorizedUser, suite.testUser.ID)
|
||||
})
|
||||
|
||||
acct := New(suite.config, suite.db)
|
||||
acct := New(suite.config, suite.db, log)
|
||||
acct.Route(r)
|
||||
|
||||
r.Start()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue