create graph api client to handle requests

This commit is contained in:
Bilal
2020-08-12 16:36:47 +02:00
parent 3352217a03
commit f25a72004e
8 changed files with 123 additions and 4 deletions

View File

@@ -5,9 +5,11 @@ class CallbacksController < ApplicationController
skip_before_action :verify_authenticity_token
def create
uid = request.env['omniauth.auth'][:uid]
token_data = request.env['omniauth.auth'][:credentials]
current_user&.tap do |user|
user.microsoft_user_id = uid
user.microsoft_access_token = token_data.token
user.microsoft_refresh_token = token_data.refresh_token
user.microsoft_token_expires_at = token_data.expires_at # Expiration time is returned in seconds