Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/multi-7c401cbcf5
Browse files Browse the repository at this point in the history
  • Loading branch information
garciafdezpatricia authored May 21, 2024
2 parents 71ca688 + 9db7637 commit aae4add
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
8 changes: 4 additions & 4 deletions e2e/test-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion e2e/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:eslint": "eslint . --ext=.js,.jsx,.ts,.tsx"
},
"dependencies": {
"@inrupt/internal-playwright-testids": "^2.6.0",
"@inrupt/internal-playwright-testids": "^3.1.0",
"@inrupt/internal-test-env": "^2.6.0",
"@inrupt/solid-client": "^2.0.0",
"@inrupt/solid-client-access-grants": "^3.0.1",
Expand Down
4 changes: 2 additions & 2 deletions pages/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default function handler(req: NextApiRequest, res: NextApiResponse) {
return res.status(405).send("Method Not Allowed");
}

const clientId = `https://${req.headers.host}/api/app`;
const hostname = `https://${req.headers.host}/`;
const clientId = new URL("/api/app", `https://${req.headers.host}`);
const hostname = new URL("/", `https://${req.headers.host}`);

const acceptedType = accepts(req).type([
"application/ld+json",
Expand Down
4 changes: 2 additions & 2 deletions scripts/updateClientId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const clientSecret = process.env.CLIENT_SECRET;

// build client id doc
const clientIdDoc = buildClientIdentifierDoc(
"http://localhost:3000/",
CLIENT_ID_DOC_IRI
new URL("http://localhost:3000/"),
new URL(CLIENT_ID_DOC_IRI)
);

async function updateClientId() {
Expand Down
12 changes: 4 additions & 8 deletions src/helpers/clientId/clientId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@

/* eslint-disable import/prefer-default-export */

export function buildClientIdentifierDoc(hostname: string, clientId: string) {
export function buildClientIdentifierDoc(hostname: URL, clientId: URL) {
return {
"@context": "https://www.w3.org/ns/solid/oidc-context.jsonld",
client_id: clientId,
client_name: "Inrupt AMC",
// URLs the user will be redirected back to upon successful authentication:
redirect_uris: [hostname, hostname.concat("login")],
redirect_uris: [hostname, new URL("login", hostname)],
// URLs the user can be redirected to back to upon successful logout:
post_logout_redirect_uris: [
hostname,
hostname.concat("login"),
hostname.concat("*"),
],
post_logout_redirect_uris: [hostname, new URL("login", hostname)],
// Support refresh_tokens for refreshing the session:
grant_types: ["authorization_code", "refresh_token"],
// The scope must be explicit, as the default doesn't include offline_access,
Expand All @@ -45,7 +41,7 @@ export function buildClientIdentifierDoc(hostname: string, clientId: string) {
require_auth_time: false,
tos_uri: "https://www.inrupt.com/terms-conditions",
policy_uri: "https://www.inrupt.com/privacy-policy",
logo_uri: hostname.concat("inrupt-hex-filled.svg"),
logo_uri: new URL("inrupt-hex-filled.svg", hostname),
client_uri: "https://www.inrupt.com/",
};
}

0 comments on commit aae4add

Please sign in to comment.