Skip to content

Commit

Permalink
Merge pull request #145 from jusabatier/patch-1
Browse files Browse the repository at this point in the history
Direct redirect if single oauth2 provider
  • Loading branch information
f-necas authored Nov 4, 2024
2 parents a00c95d + e4ee6fd commit db12f38
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public String loginPage(@RequestParam Map<String, String> allRequestParams, Mode
oauth2LoginLinks.put("/oauth2/authorization/" + k, clientName);
});
}

if (oauth2LoginLinks.size() == 1 && !ldapEnabled ) {
return "redirect:"+oauth2LoginLinks.keySet().stream().findFirst().get();
}

mdl.addAttribute("header_enabled", headerEnabled);
mdl.addAttribute("header_script", headerScript);
mdl.addAttribute("ldapEnabled", ldapEnabled);
Expand Down

0 comments on commit db12f38

Please sign in to comment.