Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Route(value = "home", layout = MainView.class)
- @RouteAlias(value = "", layout = MainView.class)
- public class StoreView extends FlexLayout {
- private DiscordOAuth2User oAuth2User = CurrentUser.get();
- private DiscordUser discordUser = oAuth2User.getDiscordUser();
- public StoreView(){
- if(isUserValid()){
- showStoreTitle();
- } else {
- Div div = new Div();
- div.setText("You are not logged in.");
- add(div);
- }
- }
- private void showStoreTitle() {
- H3 h3 = new H3(oAuth2User.getDiscordUser().getEmail());
- VerticalLayout textLayout = new VerticalLayout();
- add(textLayout, h3);
- }
- private boolean isUserValid() {
- final AccessControl accessControl = AccessControlFactory.getInstance().createAccessControl();
- return accessControl.isUserSignedIn();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement