mirror of
https://github.com/thomiceli/opengist.git
synced 2025-05-14 00:02:10 +02:00
First account registering with OAuth is now admin
This commit is contained in:
parent
2782655545
commit
3cf5bc8b76
@ -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…
x
Reference in New Issue
Block a user