Skip to content

Instantly share code, notes, and snippets.

View Rockerby's full-sized avatar
☺️

Richard Ockerby Rockerby

☺️
View GitHub Profile
@Rockerby
Rockerby / EnforceTwoFactorAuthentication.js
Last active December 29, 2025 11:14 — forked from markadrake/EnforceTwoFactorAuthentication.js
Force Users to Enable Two-Factor Authentication in Umbraco 13
(() => {
angular.module("umbraco").run(["authResource", "twoFactorLoginResource", "editorService", "notificationsService", "eventsService", "overlayService", async (authResource, twoFactorLoginResource, editorService, notificationsService, eventsService, overlayService) => {
const state = {};
const init = async (firstInit) => {
"app.ready"
state.currentUser = await authResource.getCurrentUser();
state.twoFactorAuthProviders = await twoFactorLoginResource.get2FAProvidersForUser(state.currentUser.id);