Skip to content

Commit

Permalink
Added typescript to build source for CI purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjoh committed Sep 28, 2022
1 parent f657fca commit f52c256
Show file tree
Hide file tree
Showing 8 changed files with 424 additions and 24 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Expand Up @@ -63,5 +63,4 @@ typings/
# VS Code settings
.vscode/

QSTemp/
NodeExpressQuickStart.zip
build/
9 changes: 4 additions & 5 deletions graph-sample/app.js
Expand Up @@ -27,7 +27,7 @@ app.locals.users = {};
// MSAL config
const msalConfig = {
auth: {
clientId: process.env.OAUTH_CLIENT_ID,
clientId: process.env.OAUTH_CLIENT_ID || '',
authority: process.env.OAUTH_AUTHORITY,
clientSecret: process.env.OAUTH_CLIENT_SECRET
},
Expand Down Expand Up @@ -88,12 +88,11 @@ app.set('view engine', 'hbs');

// <FormatDateSnippet>
var hbs = require('hbs');
var parseISO = require('date-fns/parseISO');
var formatDate = require('date-fns/format');
var dateFns = require('date-fns');
// Helper to format date/time sent by Graph
hbs.registerHelper('eventDateTime', function(dateTime) {
const date = parseISO(dateTime);
return formatDate(date, 'M/d/yy h:mm a');
const date = dateFns.parseISO(dateTime);
return dateFns.format(date, 'M/d/yy h:mm a');
});
// </FormatDateSnippet>

Expand Down
3 changes: 2 additions & 1 deletion graph-sample/graph.js
Expand Up @@ -101,8 +101,9 @@ function getAuthenticatedClient(msalClient, userId) {
// Attempt to get the token silently
// This method uses the token cache and
// refreshes expired tokens as needed
const scopes = process.env.OAUTH_SCOPES || 'https://graph.microsoft.com/.default';
const response = await msalClient.acquireTokenSilent({
scopes: process.env.OAUTH_SCOPES.split(','),
scopes: scopes.split(','),
redirectUri: process.env.OAUTH_REDIRECT_URI,
account: account
});
Expand Down

0 comments on commit f52c256

Please sign in to comment.