File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public sealed class AuthService
1717 private readonly OpenShockApi _apiClient ;
1818 private readonly ConfigManager _configManager ;
1919 public SelfResponse ? SelfResponse { get ; private set ; }
20+ public TokenResponse ? TokenSelf { get ; private set ; }
2021
2122 // NotAuthed
2223 // FailedAuth
@@ -68,6 +69,11 @@ public async Task Authenticate()
6869 if ( ! selfResponse . IsT0 ) throw new Exception ( "Failed to get self response" ) ;
6970 SelfResponse = selfResponse . AsT0 . Value ;
7071
72+ var tokenSelf = await _apiClient . Client ! . GetTokenSelf ( ) ;
73+ if ( ! tokenSelf . IsT0 ) throw new Exception ( "Failed to get token self response" ) ;
74+ TokenSelf = tokenSelf . AsT0 . Value ;
75+
76+
7177 _authState . Value = AuthStateType . Authed ;
7278 }
7379 catch ( Exception )
Original file line number Diff line number Diff line change 99@inject ISnackbar Snackbar
1010@inject RepositoryManager RepositoryManager
1111@inject NavigationManager NavigationManager
12+ @inject AuthService AuthService
1213@implements IAsyncDisposable
1314
1415@page " /dash/settings"
2829 <MudChip Value =" RuntimeInformation.RuntimeIdentifier" ></MudChip >
2930 </span >
3031 </div >
32+
33+
34+ <div class =" d-flex gap-5 align-center pt-2" >
35+ <span class =" d-flex align-center" >
36+ <MudText >Permissions: </MudText >
37+ @if (AuthService .TokenSelf is not null )
38+ {
39+ @foreach ( var permission in AuthService .TokenSelf .Permissions )
40+ {
41+ <MudChip Value =" permission" ></MudChip >
42+ }
43+ }
44+ </span >
45+ </div >
3146</MudPaper >
3247
3348<MudPaper Outlined =" true" Class =" rounded-lg mud-paper-padding-margin" >
You can’t perform that action at this time.
0 commit comments