@adonis-agora/authkit-server 0.68.1 → 0.68.2

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.
@@ -20,14 +20,17 @@
20
20
  @if(org.isActive)
21
21
  <span>{{ t('account.orgs.active_badge') }}</span>
22
22
  <form method="POST" action="{{ accountPaths?.orgs ?? '/account/orgs' }}/deactivate">
23
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
23
24
  <button>{{ t('account.orgs.deactivate') }}</button>
24
25
  </form>
25
26
  @else
26
27
  <form method="POST" action="{{ accountPaths?.orgs ?? '/account/orgs' }}/{{ org.id }}/activate">
28
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
27
29
  <button>{{ t('account.orgs.activate') }}</button>
28
30
  </form>
29
31
  @end
30
32
  <form method="POST" action="{{ accountPaths?.orgs ?? '/account/orgs' }}/{{ org.id }}/leave">
33
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
31
34
  <button>{{ t('account.orgs.leave') }}</button>
32
35
  </form>
33
36
  </div>
@@ -40,6 +43,7 @@
40
43
  <div>
41
44
  {{ t('account.orgs.invitation_from', { orgName: inv.orgName, role: inv.role }) }}
42
45
  <form method="POST" action="{{ accountPaths?.orgs ?? '/account/orgs' }}/invitations/{{ inv.id }}/accept">
46
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
43
47
  <button>{{ t('account.orgs.invitation_accept') }}</button>
44
48
  </form>
45
49
  </div>
@@ -49,6 +53,7 @@
49
53
  @if(allowSelfCreate)
50
54
  <h2>{{ t('account.orgs.create_section') }}</h2>
51
55
  <form method="POST" action="{{ accountPaths?.orgs ?? '/account/orgs' }}">
56
+ <input type="hidden" name="_csrf" value="{{ csrfToken }}">
52
57
  <input name="name" placeholder="{{ t('account.orgs.create_name_label') }}">
53
58
  <input name="slug" placeholder="{{ t('account.orgs.create_slug_label') }}">
54
59
  <button>{{ t('account.orgs.create_submit') }}</button>
@@ -24,7 +24,11 @@ export default class AccountOrgsController {
24
24
  const messages = cfg.messages;
25
25
  if (!supportsOrganizations(store)) {
26
26
  return cfg.render
27
- ? cfg.render(ctx, 'account/orgs', { supported: false, messages })
27
+ ? cfg.render(ctx, 'account/orgs', {
28
+ supported: false,
29
+ messages,
30
+ csrfToken: ctx.request.csrfToken,
31
+ })
28
32
  : response.notFound();
29
33
  }
30
34
  const accountId = session.get(ACCOUNT_SESSION_KEY);
@@ -54,6 +58,7 @@ export default class AccountOrgsController {
54
58
  allowSelfCreate: cfg.organizations.allowSelfCreate,
55
59
  availableRoles: cfg.organizations.roles,
56
60
  messages,
61
+ csrfToken: ctx.request.csrfToken,
57
62
  };
58
63
  return cfg.render ? cfg.render(ctx, 'account/orgs', props) : response.notFound();
59
64
  }
@@ -252,6 +257,7 @@ export default class AccountOrgsController {
252
257
  invitation,
253
258
  token: params.token,
254
259
  messages: cfg.messages,
260
+ csrfToken: ctx.request.csrfToken,
255
261
  };
256
262
  return cfg.render
257
263
  ? cfg.render(ctx, 'account/orgs', { ...props, subview: 'accept-invitation' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonis-agora/authkit-server",
3
- "version": "0.68.1",
3
+ "version": "0.68.2",
4
4
  "description": "AdonisJS OIDC/OAuth2 provider (Identity Provider) toolkit: ejectable auth server with sessions, rate-limiting, MFA/TOTP, audit log, federated logout and OpenTelemetry metrics.",
5
5
  "license": "MIT",
6
6
  "author": "dudousxd",