This commit is contained in:
2024-11-26 13:03:17 +01:00
parent b0f58f5f40
commit a84b70991d
4 changed files with 20 additions and 43 deletions
+9 -2
View File
@@ -7,6 +7,7 @@
#include <string>
#include <termios.h>
#include <unistd.h>
#include <fstream>
void safe_exit(int code) {
switch (code) {
@@ -60,9 +61,15 @@ std::string SoRAuthFile(bool save, std::string data){
std::string authfile_path = std::string(savedir_path) + "/auth";
if(save){
std::ofstream authfile(authfile_path);
authfile << data;
authfile.close();
return "";
} else {
std::ifstream authfile(authfile_path);
authfile >> data;
authfile.close();
return data;
}
}