Help us shape the future of Go! Take the 2026 Go Developer Survey

externalaccount

package
v1.16.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLastIdentity  = errors.New("keep at least one working sign-in method before unlinking")
	ErrIdentityOwned = errors.New("this identity is already bound to another account")
	ErrProviderBound = errors.New("this provider is already bound; use replace to verify a new identity")
)

Functions

func BindVerifiedIdentity added in v1.11.0

func BindVerifiedIdentity(ctx context.Context, source *auth.Source, user *user_model.User, identity goth.User, replace bool) error

BindVerifiedIdentity replaces only this provider after its new identity was authenticated.

func EnsureLinkExternalToUser

func EnsureLinkExternalToUser(ctx context.Context, authSourceID int64, user *user_model.User, gothUser goth.User) error

EnsureLinkExternalToUser link the gothUser to the user

func LinkAccountToUser

func LinkAccountToUser(ctx context.Context, authSourceID int64, user *user_model.User, gothUser goth.User) error

LinkAccountToUser link the gothUser to the user

func NativeIdentitySource added in v1.11.0

func NativeIdentitySource(source *auth.Source) bool

func SyncGoogleEmail added in v1.11.0

func SyncGoogleEmail(ctx context.Context, source *auth.Source, user *user_model.User, identity goth.User) error

SyncGoogleEmail adds an independently verified alias; the user's primary address stays their choice.

func UnlinkIdentitySource added in v1.11.0

func UnlinkIdentitySource(ctx context.Context, user *user_model.User, sourceID int64) (int64, error)

UnlinkIdentitySource retains a usable login method and removes a legacy primary OAuth identity too.

func UpdateMigrationsByType

func UpdateMigrationsByType(ctx context.Context, tp structs.GitServiceType, externalUserID string, userID int64) error

UpdateMigrationsByType updates all migrated repositories' posterid from gitServiceType to replace originalAuthorID to posterID

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL