Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ Nobodies Collective uses Google Workspace for organizational email (@nobodies.te
```
pw: <temp password>
2fa: <single backup code>

The 2fa code is a one-time backup code: use it at the verification step, then set up two-step verification properly so you don't get locked out again. How-to: <absolute URL of /Guide/TwoStepVerification>
```
so the admin can paste one message that carries the credentials and the enrollment how-to. The guide link is absolute (current request scheme + host). When backup-code generation failed (partial success, below) there is no code, and the clipboard falls back to the password-only `pw: <password>` line.
- Modal text-content is cleared on close so browser back/refresh can't re-expose the secrets
- Two audit entries recorded on the success path: `WorkspaceAccountPasswordReset` then `WorkspaceAccountBackupCodesGenerated`. The blocked-by-2SV path records `WorkspaceAccountResetBlockedFor2Sv` instead and performs no Workspace mutation.
- Requires the `admin.directory.user.security` scope on the service account credential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@
@if (recoveryCreds is not null && !string.IsNullOrEmpty(recoveryCreds.TempPassword))
{
var hasBackupCode = !string.IsNullOrEmpty(recoveryCreds.BackupCode);
var twoStepGuideUrl = Url.Action("Document", "Guide", new { name = "TwoStepVerification" }, Context.Request.Scheme);
var clipboardText = hasBackupCode
? $"pw: {recoveryCreds.TempPassword}\n2fa: {recoveryCreds.BackupCode}"
? $"pw: {recoveryCreds.TempPassword}\n2fa: {recoveryCreds.BackupCode}\n\nThe 2fa code is a one-time backup code: use it at the verification step, then set up two-step verification properly so you don't get locked out again. How-to: {twoStepGuideUrl}"
Comment thread
peterdrier marked this conversation as resolved.
: $"pw: {recoveryCreds.TempPassword}";
<div class="modal fade" id="recovery-credentials-modal" tabindex="-1" aria-labelledby="recovery-credentials-modal-label" aria-hidden="true"
data-bs-backdrop="static" data-bs-keyboard="false">
Expand All @@ -296,7 +297,7 @@
Hand these to <code>@recoveryCreds.Email</code> securely — they cannot be retrieved again after you close this dialog.
</div>

<pre id="recovery-credentials-text" class="bg-light p-3 border rounded mb-3 small">@clipboardText</pre>
<pre id="recovery-credentials-text" class="bg-light p-3 border rounded mb-3 small" style="white-space: pre-wrap;">@clipboardText</pre>

<button type="button" class="btn btn-outline-primary btn-sm" id="copy-recovery-credentials">
<i class="fa-solid fa-copy me-1"></i>Copy to clipboard
Expand Down
Loading