mirror of
https://github.com/gogs/gogs.git
synced 2025-12-24 09:10:07 +01:00
lfs: implement HTTP routes (#6035)
* Bootstrap with GORM * Fix lint error * Set conn max lifetime to one minute * Fallback to use gorm v1 * Define HTTP routes * Finish authentication * Save token updated * Add docstring * Finish authorization * serveBatch rundown * Define types in lfsutil * Finish Batch * authutil * Finish basic * Formalize response error * Fix lint errors * authutil: add tests * dbutil: add tests * lfsutil: add tests * strutil: add tests * Formalize 401 response
This commit is contained in:
@@ -23,7 +23,7 @@ func parseLoginSource(c *context.APIContext, u *db.User, sourceID int64, loginNa
|
||||
return
|
||||
}
|
||||
|
||||
source, err := db.GetLoginSourceByID(sourceID)
|
||||
source, err := db.LoginSources.GetByID(sourceID)
|
||||
if err != nil {
|
||||
if errors.IsLoginSourceNotExist(err) {
|
||||
c.ErrorStatus(http.StatusUnprocessableEntity, err)
|
||||
@@ -45,7 +45,7 @@ func CreateUser(c *context.APIContext, form api.CreateUserOption) {
|
||||
Email: form.Email,
|
||||
Passwd: form.Password,
|
||||
IsActive: true,
|
||||
LoginType: db.LOGIN_PLAIN,
|
||||
LoginType: db.LoginPlain,
|
||||
}
|
||||
|
||||
parseLoginSource(c, u, form.SourceID, form.LoginName)
|
||||
|
||||
Reference in New Issue
Block a user