#ifndef AUTHDIALOG_H
#define AUTHDIALOG_H

#include <QDialog>

namespace Ui {
class Dialog;
}

class AuthDialog : public QDialog
{
  Q_OBJECT
public:
  explicit AuthDialog(QWidget *parent = nullptr);
  ~AuthDialog();

public slots:
  void reset();
  void showError(const QString &message);

  void onCodeSentToEmail(const QString &email);

private slots:
  void onSendCodeClicked();
  void onSignInClicked();

signals:
  void codeRequested(const QString &email);
  void signInRequested(const QString &code);

private:
  Ui::Dialog *ui;

  void showEmailPage();
  void showCodePage();
  void clearError();
};

#endif // AUTHDIALOG_H
