Commit 932e0330 authored by Aqeel Padaria's avatar Aqeel Padaria

remove googleauth file

parent 74050659
......@@ -33,7 +33,6 @@ server = shinyServer(
function(input, output, session) {
source("google_auth.R",local = T)
observe({
user<<-user_details()
if(is.null(user)){
......
email_access<<-
c("@gramener.com")
get_auth_info=function (id = "me")
{
url <- sprintf("https://www.googleapis.com/plus/v1/people/%s",
id)
g <- googleAuthR::gar_api_generator(url, "GET")
req <- g()
user<- req$content
email=user$emails$value
auth="bad"
for(i in 1:length(email_access)){
if(grepl(email_access[i],email)) auth="good"
}
profile=list(displayName=user$displayName,fullname=paste(user$name$givenName,user$name$familyName,sep=" "),
email=email,imageurl=user$image$url,auth=auth)
profile
}
options(googleAuthR.scopes.selected = c("https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"))
options("googleAuthR.webapp.client_id" = "1063850569928-ktni7ff0ef0avt21611240hj6oi8jrkq.apps.googleusercontent.com")
options("googleAuthR.webapp.client_secret" = "5NJfGlsEArtEC0_MhZzeH9pe")
access_token <- callModule(googleAuth, "googleauth",login_class = "btn btn-primary",
logout_class = "btn btn-primary", login_text = "Log In",
logout_text = "Log Out",access_type="offline")
output$token<-renderText({
googleAuthR::gar_token_info()
})
#
## to use in a shiny app:
user_details <- reactive({
at=access_token()
if(!is.null(shiny::isolate(at))){
#print("not null")
if(!is.null(at$credentials$access_token)){
#print("good token")
at_back<<-at
}else{
#print("bad token")
at=at_back
}
with_shiny(get_auth_info, shiny_access_token = at)
}else{
return(NULL)
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment