| whitelist {debrowser} | R Documentation |
After a user logs in, check to see if they are on a whitelist
whitelist(user_info, whitelist = NULL)
user_info |
the object returned by get_user_info |
whitelist |
A character vector of emails on whitelist |
TRUE if on whitelist or no whitelist, FALSE if not
## Not run:
options(googleAuthR.scopes.selected =
c("https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"))
googleAuthR::gar_auth()
## default is user logged in
user <- get_user_info()
the_list <- whitelist(user, c("your@email.com",
"another@email.com",
"yet@anotheremail.com"))
if(the_list){
message("You are on the list.")
} else {
message("If you're not on the list, you're not getting in.")
}
## End(Not run)