Login-Organisation festlegen
Hier zeigen wir Ihnen, wie Sie die Option aktivieren, um die Login-Organisation für die Anwendung anzugeben.
Zum Beispiel ist der Endpunkt /login die Standard-Anmeldeseite für Konten, die zur eingebauten Organisation gehören. Sie können jedoch die Option aktivieren, um die Login-Organisation in der app-built-in Anwendung anzugeben, die zur eingebauten Organisation gehört. Dies ermöglicht dem Benutzer, eine Organisation beim Einloggen auszuwählen. Nachdem der Benutzer die Organisation ausgewählt hat, wird er zu /login/<organisation> weitergeleitet.
Configuration
Auf der Bearbeitungsseite der Anwendung finden Sie die Konfigurationsoption Org select mode. Sie können den Modus aus der Dropdown-Liste auswählen.
- Keine: Die Seite zur Auswahl der Organisation wird nicht angezeigt.
- Eingabe: Der Benutzer kann den Namen der Organisation im Eingabefeld eingeben.
- Auswählen: Der Benutzer kann die Organisation aus der Dropdown-Liste auswählen.


Die Seite zur Auswahl der Organisation wird nur angezeigt, wenn die Route /login oder <organisation>/login ist. Das bedeutet, dass die Anwendung als Standardanwendung in der Organisation oder der app-built-in eingestellt sein sollte.
Automatic Organization Redirect
When a user's session expires, Casdoor remembers which organization they last used and automatically redirects them to that organization's login page. This saves time by eliminating the need to select the organization again after a session timeout.
The organization context is stored in the browser's localStorage when you visit an organization-specific login page (e.g., /login/my-org). When your session expires and you need to log in again, Casdoor automatically redirects you to that same organization's login page instead of the generic /login page.
If no organization context is found in localStorage, you'll be redirected to the default /login page where you can select an organization using the configured mode (Input or Select) if enabled.