Skip to content

Commit 4e50b21

Browse files
Hide the Google OAuth migration reminder for logged-in users that don't use Google for authentication.
1 parent 14db6a2 commit 4e50b21

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

libs/modelParser.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ var parseUser = function (aUserData) {
264264
}
265265
};
266266

267+
// Strategies
268+
user.userStrategies = user.strategies;
269+
267270
return user;
268271
};
269272
parseModelFnMap.User = parseUser;

libs/muExpress.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ function renderFile(aRes, aPath, aOptions) {
2020
aOptions.isDev = isDev;
2121
}
2222

23+
// Hide the Google OAuth migration reminder for logged-in users
24+
// that don't use Google for authentication
25+
if (aOptions.authedUser && aOptions.authedUser
26+
.strategies.indexOf('google') === -1) {
27+
aOptions.hideReminder = true;
28+
}
29+
2330
aRes.set('Content-Type', 'text/html; charset=UTF-8');
2431
mu.compileAndRender(aPath, aOptions).pipe(aRes);
2532
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div class="reminders">
2+
{{^hideReminder}}
23
<div class="alert alert-warning alert-dismissible small fade in" role="alert">
34
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
45
<p><i class="fa fa-fw fa-exclamation-triangle"></i> <b>REMINDER:</b> Don't miss out reading the <a class="alert-link" href="/announcements/Google_Authentication_Deprecation">Google Authentication Deprecation</a> with migration announcement.</p>
56
</div>
7+
{{/hideReminder}}
68
</div>

0 commit comments

Comments
 (0)