allow empty Client for Registration

This commit is contained in:
Samuel Lorch 2021-09-02 13:31:23 +02:00
parent 279d245d86
commit 3f4ed25a83
3 changed files with 39 additions and 16 deletions

View file

@ -57,6 +57,10 @@ func (c *Client) CheckSession(ctx context.Context) bool {
// Login gets a Session and CSRF Token from Passbolt and Stores them in the Clients Cookie Jar
func (c *Client) Login(ctx context.Context) error {
if c.userPrivateKey == "" {
return fmt.Errorf("Client has no Private Key")
}
privateKeyObj, err := crypto.NewKeyFromArmored(c.userPrivateKey)
if err != nil {
return fmt.Errorf("Parsing User Private Key: %w", err)