Skip to content

Commit 5ba9ecb

Browse files
author
Savina Shen (Manpower Services Taiwan Co Ltd)
committed
modified auth for production
1 parent 0e7281c commit 5ba9ecb

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/key.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
import { IAzureMapOptions, AuthenticationType } from 'react-azure-maps';
22

3-
// export const mapOptions: IAzureMapOptions = {
4-
// authOptions: {
5-
// authType: AuthenticationType.anonymous,
6-
// clientId: '2a60774c-f588-423b-b004-56d213773ee6',
7-
// getToken: (resolve, reject) => {
8-
// fetch('https://anonymous-auth.azurewebsites.net/api/GetAccessToken-Prod')
9-
// .then((result) => result.text())
10-
// .then((result) => resolve(result))
11-
// .catch((error) => reject(new Error(`Failed to fetch anon auth token: ${error.message}`)));
12-
// },
13-
// },
14-
// center: [0, 0],
15-
// view: 'Auto',
16-
// };
17-
183
export const mapOptions: IAzureMapOptions = {
194
authOptions: {
20-
authType: AuthenticationType.subscriptionKey,
21-
subscriptionKey: '013GHvO6nMXUbB0yrRDmgizOaO3tRzevKMzPA6Yl4PeFMPgqFuelJQQJ99AGACrJL3JAArohAAAgAZMPQDp7',
5+
authType: AuthenticationType.anonymous,
6+
clientId: '2a60774c-f588-423b-b004-56d213773ee6',
7+
getToken: (resolve, reject) => {
8+
fetch('https://anonymous-auth.azurewebsites.net/api/GetAccessToken-Prod')
9+
.then((result) => result.text())
10+
.then((result) => resolve(result))
11+
.catch((error) => reject(new Error(`Failed to fetch anon auth token: ${error.message}`)));
12+
},
2213
},
2314
center: [0, 0],
2415
view: 'Auto',

0 commit comments

Comments
 (0)