@@ -9,11 +9,7 @@ import {
9
9
/**
10
10
* @see https://learn.microsoft.com/en-us/azure/active-directory/develop/scopes-oidc#openid-connect-scopes
11
11
*/
12
- export type MicrosoftScope =
13
- | 'openid'
14
- | 'email'
15
- | 'profile'
16
- | 'offline_access'
12
+ export type MicrosoftScope = "openid" | "email" | "profile" | "offline_access" ;
17
13
18
14
export interface MicrosoftStrategyOptions {
19
15
clientId : string ;
@@ -48,9 +44,13 @@ export interface MicrosoftExtraParams extends Record<string, string | number> {
48
44
id_token : string ;
49
45
}
50
46
51
- export const MicrosoftStrategyDefaultScopes : MicrosoftScope [ ] = [ 'openid' , 'profile' , 'email' ] ;
52
- export const MicrosoftStrategyDefaultName = 'microsoft' ;
53
- export const MicrosoftStrategyScopeSeperator = ' ' ;
47
+ export const MicrosoftStrategyDefaultScopes : MicrosoftScope [ ] = [
48
+ "openid" ,
49
+ "profile" ,
50
+ "email" ,
51
+ ] ;
52
+ export const MicrosoftStrategyDefaultName = "microsoft" ;
53
+ export const MicrosoftStrategyScopeSeperator = " " ;
54
54
55
55
export class MicrosoftStrategy < User > extends OAuth2Strategy <
56
56
User ,
@@ -111,14 +111,14 @@ export class MicrosoftStrategy<User> extends OAuth2Strategy<
111
111
}
112
112
113
113
protected async userProfile ( accessToken : string ) : Promise < MicrosoftProfile > {
114
- let response = await fetch ( this . userInfoURL , {
114
+ const response = await fetch ( this . userInfoURL , {
115
115
headers : {
116
116
Authorization : `Bearer ${ accessToken } ` ,
117
117
} ,
118
118
} ) ;
119
- let data : MicrosoftProfile [ "_json" ] = await response . json ( ) ;
119
+ const data : MicrosoftProfile [ "_json" ] = await response . json ( ) ;
120
120
121
- let profile : MicrosoftProfile = {
121
+ const profile : MicrosoftProfile = {
122
122
provider : MicrosoftStrategyDefaultName ,
123
123
displayName : data . name ,
124
124
id : data . sub ,
0 commit comments