#ifndef OUTLOOKAUTHENTICATOR_H
#define OUTLOOKAUTHENTICATOR_H

#include "authenticator.h"
#include "oauthcallbackserver.h"

class OutlookAuthenticator : public Authenticator
{
    Q_OBJECT
public:
    explicit OutlookAuthenticator(QObject *parent = nullptr);
    ~OutlookAuthenticator() override = default;

    void authenticate(const QString &email) override;
    void refreshToken(const Account &account) override;
    QString providerName() const override { return "outlook"; }

private slots:
    void onTokenReply(QNetworkReply *reply);
    void onAuthCodeReceived(const QString &code, const QString &state);

private:
    QString m_email;
    OAuthCallbackServer *m_callbackServer;
};

#endif // OUTLOOKAUTHENTICATOR_H