Skip to content

Commit

Permalink
Remove sync from auth
Browse files Browse the repository at this point in the history
  • Loading branch information
justinh-rahb committed Aug 18, 2023
1 parent b909b4f commit 86a3baf
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from datetime import datetime, timedelta
from flask import Blueprint, redirect, request, render_template, session
from config import CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, AUTHORIZATION_URL, TOKEN_URL
from synchronizer import synchronize_contacts

oauth2_blueprint = Blueprint('oauth2', __name__)

Expand Down Expand Up @@ -108,11 +107,7 @@ def callback():
response = requests.post(TOKEN_URL, data=token_data)
if response.status_code == 200:
data = response.json()
save_tokens_to_file(data['access_token'], data.get('refresh_token', ''), data['expires_in'])

# Trigger synchronization immediately after a successful authorization
synchronize_contacts()

save_tokens_to_file(data['access_token'], data['refresh_token'], data['expires_in'])
return render_template('success.html')
else:
handle_error(response)
Expand Down

0 comments on commit 86a3baf

Please sign in to comment.