|
16 | 16 |
|
17 | 17 | @namespace Synapse.Dashboard
|
18 | 18 |
|
19 |
| -@if(authentication != null) |
| 19 | +@if (authentication != null) |
20 | 20 | {
|
21 | 21 | <table class="table table-striped">
|
22 | 22 | <tbody>
|
|
30 | 30 | <td>
|
31 | 31 | <select class="form-select bg-secondary text-white"
|
32 | 32 | @onchange="async e => await OnAuthenticationSchemeChangedAsync(EnumHelper.Parse<AuthenticationScheme>((string)e.Value!))">
|
33 |
| - @foreach(var scheme in Enum.GetValues<AuthenticationScheme>()) |
| 33 | + @foreach (var scheme in Enum.GetValues<AuthenticationScheme>()) |
34 | 34 | {
|
35 | 35 | var schemeStr = @EnumHelper.Stringify(scheme);
|
36 | 36 | <option value="@schemeStr" selected="@(authentication.Scheme == scheme)">@schemeStr</option>
|
|
59 | 59 | </td>
|
60 | 60 | </Header>
|
61 | 61 | <Body>
|
62 |
| - @if(!useSecretBasedProperties) |
| 62 | + @if (!useSecretBasedProperties) |
63 | 63 | {
|
64 | 64 | <td colspan="3">
|
65 | 65 | @switch (authentication.Scheme)
|
66 | 66 | {
|
67 | 67 | case AuthenticationScheme.Basic:
|
68 |
| - if(authentication.Properties is not BasicAuthenticationProperties basic) |
| 68 | + if (authentication.Properties is not BasicAuthenticationProperties basic) |
69 | 69 | {
|
70 | 70 | basic = new();
|
71 | 71 | authentication.Properties = basic;
|
|
86 | 86 | </table>
|
87 | 87 | break;
|
88 | 88 | case AuthenticationScheme.Bearer:
|
89 |
| - if(authentication.Properties is not BearerAuthenticationProperties bearer) |
| 89 | + if (authentication.Properties is not BearerAuthenticationProperties bearer) |
90 | 90 | {
|
91 | 91 | bearer = new();
|
92 | 92 | authentication.Properties = bearer;
|
|
102 | 102 | </table>
|
103 | 103 | break;
|
104 | 104 | case AuthenticationScheme.OAuth2:
|
105 |
| - if(authentication.Properties is not OAuth2AuthenticationProperties oauth2) |
| 105 | + if (authentication.Properties is not OAuth2AuthenticationProperties oauth2) |
106 | 106 | {
|
107 | 107 | oauth2 = new();
|
108 | 108 | authentication.Properties = oauth2;
|
|
147 | 147 | if (Authentication == null)
|
148 | 148 | return;
|
149 | 149 | this.useSecretBasedProperties = !useSecretBasedProperties;
|
150 |
| - if(!this.useSecretBasedProperties) |
| 150 | + if (!this.useSecretBasedProperties) |
151 | 151 | return;
|
152 | 152 | this.Authentication.SecretRef = "undefined";
|
153 | 153 | await this.OnChange.InvokeAsync(this.Authentication);
|
|
166 | 166 | {
|
167 | 167 | AuthenticationScheme.Basic => new BasicAuthenticationProperties(),
|
168 | 168 | AuthenticationScheme.Bearer => new BearerAuthenticationProperties(),
|
169 |
| - AuthenticationScheme.OAuth2 => new BearerAuthenticationProperties(), |
| 169 | + AuthenticationScheme.OAuth2 => new OAuth2AuthenticationProperties(), |
170 | 170 | _ => throw new NotSupportedException($"The specified {nameof(AuthenticationScheme)} '{a.Scheme}' is not supported")
|
171 | 171 | };
|
172 | 172 | });
|
|
0 commit comments