mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Make user() available throught AbsctractCredentials
This commit is contained in:
parent
ca79d3b437
commit
2ff4ebc72f
6 changed files with 16 additions and 1 deletions
|
@ -33,6 +33,7 @@ public:
|
|||
virtual void syncContextPreStart(CSYNC* ctx) = 0;
|
||||
virtual bool changed(AbstractCredentials* credentials) const = 0;
|
||||
virtual QString authType() const = 0;
|
||||
virtual QString user() const = 0;
|
||||
virtual QNetworkAccessManager* getQNAM() const = 0;
|
||||
virtual bool ready() const = 0;
|
||||
virtual void fetch(Account *account) = 0;
|
||||
|
|
|
@ -35,6 +35,11 @@ QString DummyCredentials::authType() const
|
|||
return QString::fromLatin1("dummy");
|
||||
}
|
||||
|
||||
QString DummyCredentials::user() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
QNetworkAccessManager* DummyCredentials::getQNAM() const
|
||||
{
|
||||
return new MirallAccessManager;
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
void syncContextPreStart(CSYNC* ctx);
|
||||
bool changed(AbstractCredentials* credentials) const;
|
||||
QString authType() const;
|
||||
QString user() const;
|
||||
QNetworkAccessManager* getQNAM() const;
|
||||
bool ready() const;
|
||||
void fetch(Account*);
|
||||
|
|
|
@ -47,7 +47,6 @@ public:
|
|||
bool ready() const;
|
||||
void fetch(Account *account);
|
||||
void persist(Account *account);
|
||||
|
||||
QString user() const;
|
||||
QString password() const;
|
||||
|
||||
|
|
|
@ -146,6 +146,14 @@ QString ShibbolethCredentials::authType() const
|
|||
return QString::fromLatin1("shibboleth");
|
||||
}
|
||||
|
||||
QString ShibbolethCredentials::user() const
|
||||
{
|
||||
// ### TODO: If we had a way to extract the currently authenticated user
|
||||
// somehow, we could return its id token (email) here (stored in REMOTE_USER)
|
||||
// The server doesn't return it by default
|
||||
return QString();
|
||||
}
|
||||
|
||||
QNetworkCookie ShibbolethCredentials::cookie() const
|
||||
{
|
||||
return _shibCookie;
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
void syncContextPreStart(CSYNC* ctx);
|
||||
bool changed(AbstractCredentials* credentials) const;
|
||||
QString authType() const;
|
||||
QString user() const;
|
||||
QNetworkAccessManager* getQNAM() const;
|
||||
bool ready() const;
|
||||
void fetch(Account *account);
|
||||
|
|
Loading…
Reference in a new issue