Add first google auth

This commit is contained in:
Achim Rohn
2025-09-17 14:58:13 +02:00
parent ad363251e4
commit 2a3506d21b
20 changed files with 2614 additions and 12 deletions
+12
View File
@@ -8,6 +8,18 @@ import (
"fmt"
)
// The GoogleAuthFunc type is an adapter to allow the use of ordinary
// function as GoogleAuth mutator.
type GoogleAuthFunc func(context.Context, *ent.GoogleAuthMutation) (ent.Value, error)
// Mutate calls f(ctx, m).
func (f GoogleAuthFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if mv, ok := m.(*ent.GoogleAuthMutation); ok {
return f(ctx, mv)
}
return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.GoogleAuthMutation", m)
}
// The UserFunc type is an adapter to allow the use of ordinary
// function as User mutator.
type UserFunc func(context.Context, *ent.UserMutation) (ent.Value, error)