Add first google auth
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user