@raketa-cloud/admin 0.0.73 → 0.0.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-cloud/admin",
3
- "version": "0.0.73",
3
+ "version": "0.0.74",
4
4
  "main": "src/index.js",
5
5
  "scripts": {
6
6
  "dev": "npx tailwindcss -i ./src/styles/application.css -o ../../apps/admin/static/application.css --watch",
@@ -38,13 +38,6 @@ export default class HonoAdapter extends Adapter {
38
38
  // TODO: Pass in a path to redirect to after login?
39
39
  setupAuthentication(
40
40
  router,
41
- {
42
- remote: {
43
- domain: "localhost",
44
- host: "http://localhost:3000",
45
- cookie_key: "cms-starter-slim",
46
- },
47
- },
48
41
  config
49
42
  );
50
43
 
@@ -68,8 +68,6 @@ const update = async (ctx) => {
68
68
  const params = ctx.resourceParams.resource ? ctx.resourceParams.resource : {};
69
69
  const resource = ctx.client.pageRevisions.deepMerge(revision, params);
70
70
 
71
- console.log({ params });
72
-
73
71
  const { errors } = await ctx.client.pageRevisions.update(
74
72
  revision.id,
75
73
  ctx.locale,
@@ -9,7 +9,7 @@ function getAuthBearer(c) {
9
9
  return authHeader.replace("Bearer ", "");
10
10
  }
11
11
 
12
- const setupAuthentication = (app, opts, config) => {
12
+ const setupAuthentication = (app, config) => {
13
13
  app.use(async (c, next) => {
14
14
  const token = getCookie(c, AuthHelper.cookie_key) || getAuthBearer(c);
15
15
 
@@ -67,7 +67,7 @@ const setupAuthentication = (app, opts, config) => {
67
67
 
68
68
  app.get("/logout", (c) => {
69
69
  deleteCookie(c, AuthHelper.cookie_key);
70
- deleteCookie(c, opts.remote.cookie_key);
70
+ deleteCookie(c, config.remoteConfig.cookie_key);
71
71
  return c.redirect("/login");
72
72
  });
73
73
 
@@ -79,14 +79,14 @@ const setupAuthentication = (app, opts, config) => {
79
79
  return c.redirect("/login");
80
80
  }
81
81
 
82
- setCookie(c, opts.remote.cookie_key, token, {
82
+ setCookie(c, config.remoteConfig.cookie_key, token, {
83
83
  path: "/",
84
84
  httpOnly: true,
85
85
  secure: true,
86
- domain: opts.remote.domain,
86
+ domain: config.remoteConfig.domain,
87
87
  });
88
88
 
89
- return c.redirect([opts.remote.host, c.req.query().redirect_to].join(""));
89
+ return c.redirect([config.remoteConfig.host, c.req.query().redirect_to].join(""));
90
90
  });
91
91
 
92
92
  app.get("/profile", (c) => {
@@ -12,7 +12,7 @@
12
12
  </form>
13
13
  <% } %>
14
14
 
15
- <a href="#" class="btn-text hidden">
15
+ <a href="/remote-login?redirect_to=/admin/<%= _context.resourceConfig.articleTypePlural %>/<%= resource.id %>/changes/<%= change.version %>" class="btn-text has-icon">
16
16
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
17
17
  <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
18
18
  <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
@@ -12,7 +12,7 @@
12
12
  </form>
13
13
  <% } %>
14
14
 
15
- <a href="#" class="btn-text hidden">
15
+ <a href="/remote-login?redirect_to=/admin/<%= _context.resourceConfig.eventTypePlural %>/<%= resource.id %>/changes/<%= change.version %>" class="btn-text has-icon">
16
16
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
17
17
  <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
18
18
  <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
@@ -12,7 +12,7 @@
12
12
  </form>
13
13
  <% } %>
14
14
 
15
- <a href="#" class="btn-text hidden">
15
+ <a href="/remote-login?redirect_to=/admin/<%= _context.resourceConfig.pageTypePlural %>/<%= resource.id %>/changes/<%= change.version %>" class="btn-text has-icon">
16
16
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
17
17
  <path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" />
18
18
  <path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />