Updated subscriptions
This commit is contained in:
22
backend/internal/firebase/users.go
Normal file
22
backend/internal/firebase/users.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package firebase
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"firebase.google.com/go/v4/auth"
|
||||
)
|
||||
|
||||
// SetUserDisabled updates the Firebase user record's disabled flag.
|
||||
func SetUserDisabled(ctx context.Context, uid string, disabled bool) error {
|
||||
if authClient == nil {
|
||||
return fmt.Errorf("firebase auth not initialized") //nolint:err113
|
||||
}
|
||||
if uid == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
params := (&auth.UserToUpdate{}).Disabled(disabled)
|
||||
_, err := authClient.UpdateUser(ctx, uid, params)
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user