mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 08:23:16 +00:00
cleanup login prompt
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { getAllSessions } from "@/lib/cookies";
|
import { getAllSessions } from "@/lib/cookies";
|
||||||
import { idpTypeToSlug } from "@/lib/idp";
|
import { idpTypeToSlug } from "@/lib/idp";
|
||||||
import { sendLoginname } from "@/lib/server/loginname";
|
import { sendLoginname, SendLoginnameCommand } from "@/lib/server/loginname";
|
||||||
import {
|
import {
|
||||||
createCallback,
|
createCallback,
|
||||||
getActiveIdentityProviders,
|
getActiveIdentityProviders,
|
||||||
@@ -276,11 +276,16 @@ export async function GET(request: NextRequest) {
|
|||||||
// if a hint is provided, skip loginname page and jump to the next page
|
// if a hint is provided, skip loginname page and jump to the next page
|
||||||
if (authRequest.loginHint) {
|
if (authRequest.loginHint) {
|
||||||
try {
|
try {
|
||||||
const res = await sendLoginname({
|
let command: SendLoginnameCommand = {
|
||||||
loginName: authRequest.loginHint,
|
loginName: authRequest.loginHint,
|
||||||
organization,
|
|
||||||
authRequestId: authRequest.id,
|
authRequestId: authRequest.id,
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (organization) {
|
||||||
|
command = { ...command, organization };
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await sendLoginname(command);
|
||||||
|
|
||||||
if (res?.redirect) {
|
if (res?.redirect) {
|
||||||
const absoluteUrl = new URL(res.redirect, request.url);
|
const absoluteUrl = new URL(res.redirect, request.url);
|
||||||
|
|||||||
Reference in New Issue
Block a user