Expose oauth access token via api interface

This commit is contained in:
Dean Herbert
2020-10-22 15:03:43 +09:00
parent 175fd512b0
commit 4788b4a643
3 changed files with 8 additions and 1 deletions

View File

@ -20,6 +20,8 @@ namespace osu.Game.Online.API
public Bindable<UserActivity> Activity { get; } = new Bindable<UserActivity>(); public Bindable<UserActivity> Activity { get; } = new Bindable<UserActivity>();
public string AccessToken => "token";
public bool IsLoggedIn => State.Value == APIState.Online; public bool IsLoggedIn => State.Value == APIState.Online;
public string ProvidedUsername => LocalUser.Value.Username; public string ProvidedUsername => LocalUser.Value.Username;

View File

@ -19,6 +19,11 @@ namespace osu.Game.Online.API
/// </summary> /// </summary>
Bindable<UserActivity> Activity { get; } Bindable<UserActivity> Activity { get; }
/// <summary>
/// Retrieve the OAuth access token.
/// </summary>
public string AccessToken { get; }
/// <summary> /// <summary>
/// Returns whether the local user is logged in. /// Returns whether the local user is logged in.
/// </summary> /// </summary>

View File

@ -23,7 +23,7 @@ namespace osu.Game.Online.Spectator
private readonly IBindable<APIState> apiState = new Bindable<APIState>(); private readonly IBindable<APIState> apiState = new Bindable<APIState>();
[Resolved] [Resolved]
private APIAccess api { get; set; } private IAPIProvider api { get; set; }
[Resolved] [Resolved]
private IBindable<WorkingBeatmap> beatmap { get; set; } private IBindable<WorkingBeatmap> beatmap { get; set; }