mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2024-11-25 23:52:48 +00:00
changed auth ctors to return concrete types
This commit is contained in:
parent
31c378db5a
commit
37165658e1
|
@ -20,7 +20,7 @@ var ErrDLNotFound = errors.New("DiscordLogin not found. Please install it from t
|
||||||
// application if possible. If not, it'll try and exec up a browser.
|
// application if possible. If not, it'll try and exec up a browser.
|
||||||
type DiscordLoginAuth struct{}
|
type DiscordLoginAuth struct{}
|
||||||
|
|
||||||
func NewDiscordLogin() cchat.Authenticator {
|
func NewDiscordLogin() DiscordLoginAuth {
|
||||||
return DiscordLoginAuth{}
|
return DiscordLoginAuth{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ type LoginAuthenticator struct {
|
||||||
client *api.Client
|
client *api.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLoginAuthenticator() cchat.Authenticator {
|
func NewLoginAuthenticator() *LoginAuthenticator {
|
||||||
return &LoginAuthenticator{
|
return &LoginAuthenticator{
|
||||||
client: api.NewClient(""),
|
client: api.NewClient(""),
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
// authenticate directly using a token.
|
// authenticate directly using a token.
|
||||||
type TokenAuthenticator struct{}
|
type TokenAuthenticator struct{}
|
||||||
|
|
||||||
func NewTokenAuthenticator() cchat.Authenticator {
|
func NewTokenAuthenticator() TokenAuthenticator {
|
||||||
return TokenAuthenticator{}
|
return TokenAuthenticator{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ type TOTPAuthenticator struct {
|
||||||
ticket string
|
ticket string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTOTPAuthenticator(ticket string) cchat.Authenticator {
|
func NewTOTPAuthenticator(ticket string) *TOTPAuthenticator {
|
||||||
return &TOTPAuthenticator{
|
return &TOTPAuthenticator{
|
||||||
client: api.NewClient(""),
|
client: api.NewClient(""),
|
||||||
ticket: ticket,
|
ticket: ticket,
|
||||||
|
|
Loading…
Reference in a new issue