Merge branch '2-mauvaise-permissions-sur-le-fichier-de-token' into 'master'
Resolve "Mauvaise permissions sur le fichier de token" Closes #2 See merge request Neutrinet/matrix-alertbot!2
This commit is contained in:
commit
e05497d742
1 changed files with 7 additions and 1 deletions
|
@ -109,7 +109,13 @@ async def start_matrix_client(
|
|||
return False
|
||||
|
||||
# Save user's access token and device ID
|
||||
with open(config.user_token_file, "w") as ofd:
|
||||
# See https://stackoverflow.com/a/45368120
|
||||
user_token_fd = os.open(
|
||||
config.user_token_file,
|
||||
flags=os.O_CREAT | os.O_WRONLY | os.O_TRUNC,
|
||||
mode=0o640,
|
||||
)
|
||||
with os.fdopen(user_token_fd, "w") as ofd:
|
||||
json.dump(
|
||||
{
|
||||
"device_id": login_response.device_id,
|
||||
|
|
Loading…
Reference in a new issue