CA: warn if no access token present
Change-Id: Iec2e57edc7bb62bfed23672ada549252ba03518e
diff --git a/R/KorAPConnection.R b/R/KorAPConnection.R
index 9c5a141..83bfd5e 100644
--- a/R/KorAPConnection.R
+++ b/R/KorAPConnection.R
@@ -135,6 +135,20 @@
NULL
}
+
+warnIfNoAccessToken <- function(kco) {
+ if (is.null(kco@accessToken)) {
+ warning(
+ paste0(
+ "In order to receive KWICSs also from corpora with restricted licenses, you need an access token.\n",
+ "To generate an access token, login to KorAP and navigite to KorAP's OAuth settings <",
+ kco@KorAPUrl,
+ "settings/oauth#page-top>"
+ )
+ )
+ }
+}
+
KorAPCacheSubDir <- function() {
paste0("RKorAPClient_",
gsub(