Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Getting another users calendarView needs to use application token
Browse files Browse the repository at this point in the history
  • Loading branch information
runely committed Mar 17, 2022
1 parent 8d5bf12 commit 318e7f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/graph/get-graph-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const getGraphToken = require('./get-graph-token')
const { graph: { user, events } } = require('../../config')

module.exports = async (context, token, userPrincipalName, graphUserUrl, daysAhead) => {
if (!token) {
// If no token is provided - gather application graph token
if (!token || (graphUserUrl && graphUserUrl.includes('/users/'))) {
// If no token is provided OR graphUserUrl is a URL for /users/... - gather application graph token
context.log(['events', 'get-graph-events', userPrincipalName, 'get-graph-token'])
token = await getGraphToken(context)
context.log(['events', 'get-graph-user', userPrincipalName, 'get-graph-token', 'length', token.length])
Expand Down

0 comments on commit 318e7f5

Please # to comment.