@page "/Login" @using MatrixRoomUtils.Authentication @using MatrixRoomUtils.Web.Classes @using Blazored.LocalStorage @inject ILocalStorageService LocalStorage

Login






@code { string homeserver = ""; string username = ""; string password = ""; async Task Login() { var result = await MatrixAuth.Login(homeserver, username, password); Console.WriteLine($"Obtained access token for {result.UserId}!"); LocalStorageWrapper.AccessToken = result.AccessToken; var userinfo = new UserInfo() { LoginResponse = result }; userinfo.Profile = await MatrixAuth.GetProfile(result.HomeServer, result.UserId); LocalStorageWrapper.LoginSessions.Add(result.AccessToken, userinfo); LocalStorageWrapper.CurrentHomeserver = await MatrixAuth.ResolveHomeserverFromWellKnown(result.HomeServer); await LocalStorageWrapper.SaveToLocalStorage(LocalStorage); } }