Skip to content

Commit

Permalink
control alexa during auth
Browse files Browse the repository at this point in the history
  • Loading branch information
subjectxbj committed Jul 4, 2018
1 parent 00b613e commit 29bb16a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,15 @@ void respond(int n)
if (ret == 0) {
printf("\nGOOD: successfully generated the config with refresh token. Exit.\n");
ret = sendFromDirectory(clients[n], web_root, "things_to_try.html");
system("service alexa restart");
}
}else if(strncmp(reqline[1], "/login", 6)==0) {
ret = handleUserRequest(clients[n], json_config);
}else if(strncmp(reqline[1], "/logout", 7)==0) {
copyFile(config_default_path, config_path);
ret = sendRedirect(clients[n], "/splash_screen.html");
// Force to stop alexa
system("service alexa stop");
}
else{
ret = sendFromDirectory(clients[n], web_root, reqline[1]);
Expand Down

0 comments on commit 29bb16a

Please sign in to comment.