public static async Task <MisskeyAccount> Authorize(MisskeyInstance instance) { var app = new Misq.App($"https://{instance.Host}", instance.AppSecret); var user = await app.Authorize(); return(new MisskeyAccount(instance.Host, user.Token, user.Username, user.ID)); }
private async void AuthForm_Load(object sender, EventArgs e) { var app = new Misq.App("https://misskey.xyz", Misskey.Service.appKey); var me = await app.Authorize(); this.Close(); this.onComplete(me); MessageBox.Show( $"WELCOME {me.Username}", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private async void AuthForm_Load(object sender, EventArgs e) { var app = new Misq.App("https://misskey.xyz", Service.appKey); var done = await app.Authorize(); this.button1.Click += async(_1, _2) => { var me = await done(); this.Close(); this.onComplete(me); }; }