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
+34
View File
@@ -0,0 +1,34 @@
package schema
import (
ersteller_ent "ersteller-lib/schema/ent"
google "ersteller-lib/starter/google"
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
type GoogleAuth struct {
ent.Schema
}
func (GoogleAuth) Mixin() []ent.Mixin {
return []ent.Mixin{
ersteller_ent.TimeMixin{},
}
}
func (GoogleAuth) Fields() []ent.Field {
return []ent.Field{
field.JSON("credentials", google.Credentials{}),
}
}
func (GoogleAuth) Edges() []ent.Edge {
return []ent.Edge{
edge.To("user", User.Type).
Unique().
Required(),
}
}