[#276] added support for linking external auths by provider id
This commit is contained in:
@@ -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"
|
||||
}
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user