This is a combination of 4 commits.
Fix the image
This commit is contained in:
@ -4,25 +4,30 @@ import (
|
||||
"context"
|
||||
|
||||
"git.badhouseplants.net/softplayer/softplayer-backend/internal/controllers"
|
||||
"git.badhouseplants.net/softplayer/softplayer-backend/internal/helpers/email"
|
||||
"git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts"
|
||||
|
||||
// "google.golang.org/protobuf/types/known/emptypb"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
)
|
||||
|
||||
func NewAccountRPCImpl(contoller ctrl.Manager) *AccountsServer {
|
||||
func NewAccountRPCImpl(contoller ctrl.Manager, emailConfig email.EmailConf) *AccountsServer {
|
||||
return &AccountsServer{
|
||||
Controller: contoller,
|
||||
EmailConfig: emailConfig,
|
||||
}
|
||||
}
|
||||
|
||||
type AccountsServer struct {
|
||||
accounts.UnimplementedAccountsServer
|
||||
EmailConfig email.EmailConf
|
||||
Controller ctrl.Manager
|
||||
}
|
||||
|
||||
func (a *AccountsServer) SignUp(ctx context.Context, in *accounts.AccountWithPassword) (*accounts.AccountFullWithToken, error) {
|
||||
data := controllers.AccountData{
|
||||
Username: in.Data.GetName(),
|
||||
Password: in.AccountPassword.GetPassword(),
|
||||
Password: in.Password.GetPassword(),
|
||||
Email: in.Data.GetEmail(),
|
||||
}
|
||||
acc := controllers.Account{
|
||||
@ -41,14 +46,14 @@ func (a *AccountsServer) SignUp(ctx context.Context, in *accounts.AccountWithPas
|
||||
Name: acc.Data.Username,
|
||||
Email: acc.Data.Email,
|
||||
},
|
||||
Token: acc.Kubeconfig,
|
||||
Token: acc.Token,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (a *AccountsServer) SignIn(ctx context.Context, in *accounts.AccountWithPassword) (*accounts.AccountFullWithToken, error) {
|
||||
data := controllers.AccountData{
|
||||
Username: in.Data.GetName(),
|
||||
Password: in.AccountPassword.GetPassword(),
|
||||
Password: in.Password.GetPassword(),
|
||||
Email: in.Data.GetEmail(),
|
||||
}
|
||||
acc := controllers.Account{
|
||||
@ -66,6 +71,14 @@ func (a *AccountsServer) SignIn(ctx context.Context, in *accounts.AccountWithPas
|
||||
Name: acc.Data.Username,
|
||||
Email: acc.Data.Email,
|
||||
},
|
||||
Token: acc.Kubeconfig,
|
||||
Token: acc.Token,
|
||||
}, nil
|
||||
}
|
||||
|
||||
//func (a *AccountsServer) ValidateEmail(ctx context.Context, in *accounts.AccountDataWithEmailCode) (*emptypb.Empty, error) {
|
||||
// data := controllers.AccountData {
|
||||
// Username: in.Data.GetName(),
|
||||
// Email: in.Data.GetEmail(),
|
||||
// }
|
||||
// acc := controllers.Account {}
|
||||
//}
|
||||
|
Reference in New Issue
Block a user