Skip to content

Commit

Permalink
feat: add missing Sign Up and Sign In items fields in Application (#87)
Browse files Browse the repository at this point in the history
* fix: Application Sign Up and Sign In fields for organisation (#86)

The Application entity found at org.casbin.casdoor.entity.Application is missing required fields that are needed to correctly load the OAuth2 page and admin dashboard.

Fields missing are:

- Sign Up Items
- Sign In Items
- Sign In Methods

Due to these missing fields the database is holding null. This results with a front-end error as the UI is expecting an array (even if it's an empty array) in comparison to null for both the OAuth2 login page, and the Admin Dashboard.

* Update Application.java

---------

Co-authored-by: Yang Luo <hsluoyz@qq.com>
  • Loading branch information
CameronMukherjee and hsluoyz authored Sep 22, 2024
1 parent 391e3d2 commit 42e4dae
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/main/java/org/casbin/casdoor/entity/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public class Application implements Serializable {
public int formOffset;
public String formSideHtml;
public String formBackgroundUrl;
public List<SigninMethod> signinMethods;
public List<SigninItem> signinItems;
public List<SignupItem> signupItems;

public Application() {
}
Expand All @@ -71,4 +74,30 @@ public Application(String owner, String name, String createdTime, String display
this.description = description;
this.organization = organization;
}
}

public static class SigninMethod {
public String name;
public String displayName;
public String rule;
}

public static class SigninItem {
public String name;
public boolean visible;
public String label;
public String placeholder;
public String rule;
public boolean isCustom;
}

public static class SignupItem {
public String label;
public String name;
public String placeholder;
public boolean prompted;
public String regex;
public boolean required;
public String rule;
public boolean visible;
}
}

0 comments on commit 42e4dae

Please sign in to comment.