single-object

This commit is contained in:
peintnermax
2024-08-08 09:24:03 +02:00
parent afa024f1e4
commit cacd4e76a2
7 changed files with 29 additions and 15 deletions

View File

@@ -29,10 +29,10 @@ export default async function Page({
loginName?: string,
organization?: string,
) {
const recent = await getMostRecentCookieWithLoginname(
const recent = await getMostRecentCookieWithLoginname({
loginName,
organization,
);
});
return getSession(recent.id, recent.token).then((response) => {
if (response?.session && response.session.factors?.user?.id) {
return listAuthenticationMethodTypes(

View File

@@ -20,7 +20,7 @@ export async function POST(request: NextRequest) {
return Promise.reject(error);
})
: loginName
? getSessionCookieByLoginName(loginName, organization).catch(
? getSessionCookieByLoginName({ loginName, organization }).catch(
(error) => {
return Promise.reject(error);
},

View File

@@ -80,7 +80,7 @@ export async function PUT(request: NextRequest) {
return Promise.reject(error);
})
: loginName
? getSessionCookieByLoginName(loginName, organization).catch(
? getSessionCookieByLoginName({ loginName, organization }).catch(
(error) => {
return Promise.reject(error);
},