-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump to @ory/client 1.0.1 #225
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,10 +1,14 @@ | ||||||||||
// Copyright © 2022 Ory Corp | ||||||||||
// SPDX-License-Identifier: Apache-2.0 | ||||||||||
import { V0alpha2ApiInterface } from "@ory/client" | ||||||||||
import { | ||||||||||
FrontendApi, | ||||||||||
FrontendApiInterface, | ||||||||||
OAuth2ApiInterface, | ||||||||||
} from "@ory/client" | ||||||||||
import { Application, NextFunction, Request, Response } from "express" | ||||||||||
|
||||||||||
export interface RouteOptions { | ||||||||||
sdk: V0alpha2ApiInterface | ||||||||||
frontend: FrontendApi | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
apiBaseUrl: string | ||||||||||
kratosBrowserUrl: string | ||||||||||
logo?: string | ||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// Copyright © 2022 Ory Corp | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { SelfServiceLoginFlow, UiNodeInputAttributes } from "@ory/client" | ||
import { LoginFlow, UiNodeInputAttributes } from "@ory/client" | ||
import { UserAuthCard, SelfServiceFlow } from "@ory/elements-markup" | ||
import { | ||
filterNodesByGroups, | ||
|
@@ -27,7 +27,7 @@ export const createLoginRoute: RouteCreator = | |
return_to = "", | ||
login_challenge, | ||
} = req.query | ||
const { sdk, kratosBrowserUrl, logo } = createHelpers(req) | ||
const { frontend, kratosBrowserUrl, logo } = createHelpers(req) | ||
|
||
const initFlowQuery = new URLSearchParams({ | ||
aal: aal.toString(), | ||
|
@@ -57,14 +57,14 @@ export const createLoginRoute: RouteCreator = | |
// to give the user the option to sign out! | ||
const logoutUrl = | ||
( | ||
await sdk | ||
.createSelfServiceLogoutFlowUrlForBrowsers(req.header("cookie")) | ||
await frontend | ||
.createBrowserLogoutFlow(req.header("cookie")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of passing these parameters as named parameters, they're now passed in a single |
||
.catch(() => ({ data: { logout_url: "" } })) | ||
).data.logout_url || "" | ||
|
||
return sdk | ||
.getSelfServiceLoginFlow(flow, req.header("cookie")) | ||
.then(({ data: flow }: { data: SelfServiceLoginFlow & any }) => { | ||
return frontend | ||
.getLoginFlow(flow, req.header("cookie")) | ||
.then(({ data: flow }: { data: LoginFlow & any }) => { | ||
// Render the data using a view (e.g. Jade Template): | ||
|
||
const initRegistrationQuery = new URLSearchParams({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That way you have
frontend
(and the other APIs) available, but they're setup with the correct configuration.