Improved UX on login for new users

main
Inga 🏳‍🌈 15 years ago
parent 1f6465d3f4
commit fa112b55e7
  1. 2
      Builder/IISMainHandler/build.txt
  2. 9
      IISMainHandler/handlers/request/LoginHandler.cs
  3. 2
      IISMainHandler/handlers/response/MigrateAccountHandler.cs

@ -29,6 +29,15 @@ namespace FLocal.IISHandler.handlers.request {
}
protected override XElement[] Do(WebContext context) {
try {
Account tmpAccount = Account.LoadByName(context.httprequest.Form["name"]);
if(tmpAccount.needsMigration) {
throw new RedirectException("/MigrateAccount/" + context.httprequest.Form["name"]);
}
} catch(NotFoundInDBException) {
}
Account account = Account.tryAuthorize(context.httprequest.Form["name"], context.httprequest.Form["password"]);
Session session = Session.create(account);

@ -18,7 +18,7 @@ namespace FLocal.IISHandler.handlers.response {
protected override System.Xml.Linq.XElement[] getSpecificData(WebContext context) {
string username;
if(context.httprequest.Form["username"] != "") {
if(context.httprequest.Form["username"] != null && context.httprequest.Form["username"] != "") {
username = context.httprequest.Form["username"];
} else {
if(context.requestParts.Length != 2) {

Loading…
Cancel
Save