mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-23 04:52:40 +00:00
First account registering with OAuth is now admin
This commit is contained in:
parent
2782655545
commit
3cf5bc8b76
1 changed files with 6 additions and 0 deletions
|
@ -178,6 +178,12 @@ func oauthCallback(ctx echo.Context) error {
|
|||
return errorRes(500, "Cannot create user", err)
|
||||
}
|
||||
|
||||
if userDB.ID == 1 {
|
||||
if err = userDB.SetAdmin(); err != nil {
|
||||
return errorRes(500, "Cannot set user admin", err)
|
||||
}
|
||||
}
|
||||
|
||||
var resp *http.Response
|
||||
switch user.Provider {
|
||||
case "github":
|
||||
|
|
Loading…
Reference in a new issue