[#276] added support for linking external auths by provider id

This commit is contained in:
Gani Georgiev
2022-08-31 13:38:31 +03:00
parent 9fe94f5c7d
commit f5ff7193a9
33 changed files with 924 additions and 223 deletions
+15
View File
@@ -0,0 +1,15 @@
package models
var _ Model = (*ExternalAuth)(nil)
type ExternalAuth struct {
BaseModel
UserId string `db:"userId" json:"userId"`
Provider string `db:"provider" json:"provider"`
ProviderId string `db:"providerId" json:"providerId"`
}
func (m *ExternalAuth) TableName() string {
return "_externalAuths"
}
+14
View File
@@ -0,0 +1,14 @@
package models_test
import (
"testing"
"github.com/pocketbase/pocketbase/models"
)
func TestExternalAuthTableName(t *testing.T) {
m := models.ExternalAuth{}
if m.TableName() != "_externalAuths" {
t.Fatalf("Unexpected table name, got %q", m.TableName())
}
}