File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
dataverse/webapi/JS/SPASample/src/scripts Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ const container = document.getElementById("container");
42
42
43
43
const util = new Util ( container ) ;
44
44
45
+ // <logIn>
45
46
// Event handler for login button
46
47
async function logIn ( ) {
47
48
await msalInstance . initialize ( ) ;
@@ -72,7 +73,9 @@ async function logIn() {
72
73
this . click ( ) ;
73
74
}
74
75
}
76
+ // </logIn>
75
77
78
+ // <logOut>
76
79
// Event handler for logout button
77
80
async function logOut ( ) {
78
81
const activeAccount = await msalInstance . getActiveAccount ( ) ;
@@ -96,7 +99,9 @@ async function logOut() {
96
99
// Clear the client instance
97
100
client = null ;
98
101
}
102
+ // </logOut>
99
103
104
+ // <getToken>
100
105
/**
101
106
* Retrieves an access token using MSAL (Microsoft Authentication Library).
102
107
* Set as the getToken function for the DataverseWebAPI client in the login function.
@@ -124,7 +129,9 @@ async function getToken() {
124
129
}
125
130
}
126
131
}
132
+ // </getToken>
127
133
134
+ // <runSample>
128
135
// Runs all samples in a consistent way
129
136
async function runSample ( sample ) {
130
137
// Disable the buttons to prevent multiple clicks
@@ -142,6 +149,7 @@ async function runSample(sample) {
142
149
document . getElementsByTagName ( "nav" ) [ 0 ] . classList . remove ( "disabled" ) ;
143
150
logoutButton . classList . remove ( "disabled" ) ;
144
151
}
152
+ // </runSample>
145
153
146
154
//#region verify that configuration has been updated.
147
155
You can’t perform that action at this time.
0 commit comments