Skip to content

Commit

Permalink
fix: address auth callback bugs (#1159)
Browse files Browse the repository at this point in the history
  • Loading branch information
abvthecity authored Jul 15, 2024
1 parent c8e3693 commit 2a52f99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ui/app/src/auth/OAuth2Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class OAuth2Client {
url.searchParams.set("response_type", "code");
url.searchParams.set("client_id", this.clientId);
// if (this.redirect_uri != null) {
// url.searchParams.set("redirect_uri", encodeURIComponent(this.redirect_uri));
// url.searchParams.set("redirect_uri", this.redirect_uri);
// }
if (state != null) {
url.searchParams.set("state", state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function GET(req: NextRequest): Promise<NextResponse> {
const oauthClient = new OAuth2Client(config, urlJoin(`https://${domain}`, req.nextUrl.pathname));
try {
const { access_token, refresh_token } = await oauthClient.getToken(code);
const token = OryAccessTokenSchema.parse(oauthClient.decode(access_token));
const token = OryAccessTokenSchema.parse(await oauthClient.decode(access_token));
const fernUser: FernUser = {
type: "user",
partner: "ory",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/docs-bundle/src/utils/getDocsPageProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function getUnauthenticatedRedirect(xFernHost: string, path: string): Prom
const authorizationUrl = getAuthorizationUrl(
{
organization: await maybeGetWorkosOrganization(xFernHost),
state: encodeURIComponent(urlJoin(`https://${xFernHost}`, path)),
state: urlJoin(`https://${xFernHost}`, path),
},
xFernHost,
);
Expand Down

0 comments on commit 2a52f99

Please sign in to comment.