First account registering with OAuth is now admin

This commit is contained in:
Thomas Miceli 2023-05-04 11:48:26 +02:00
parent 2782655545
commit 3cf5bc8b76
No known key found for this signature in database
GPG key ID: D86C6F6390AF050F

View file

@ -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":