diff --git a/server/authentication.py b/server/authentication.py index b3612c3..3610e9c 100644 --- a/server/authentication.py +++ b/server/authentication.py @@ -83,7 +83,7 @@ class Authetication: ##Save private key in separate file user_privatekey = {'passphrase': user_passphrase, 'privateClientKey': private_key_value, 'publicServerKey': public_server_key} - with open(self.PRIVATE_KEY_DIRECTORY_LOCATION + '\\' + str(data['index']) + '.txt', 'w+') as outfile: + with open(self.PRIVATE_KEY_DIRECTORY_LOCATION + os.path.sep + str(data['index']) + '.txt', 'w+') as outfile: json.dump(user_privatekey, outfile) ##Save public key in users @@ -110,7 +110,7 @@ class Authetication: auth_logger.debug("User NOT saved! This username already exists!") return False else: - if not os.path.isdir(self.HOME_DIRECTORY_LOCATION + "\\" + str(data['index'] + 1)): + if not os.path.isdir(self.HOME_DIRECTORY_LOCATION + os.path.sep + str(data['index'] + 1)): data['index'] = data['index'] + 1 user = { 'username': username, @@ -120,7 +120,7 @@ class Authetication: } ##Create user HOME directory with index as name - os.mkdir(self.HOME_DIRECTORY_LOCATION + '\\' + str(data['index'])) + os.mkdir(self.HOME_DIRECTORY_LOCATION + os.path.sep + str(data['index'])) ##Save user data data['user'].append(user)