Posts

Retro Review: The Mummy's Curse

Image
Synopsis Two museum archaeologists arrive at a swamp 25 years after the events of the previous film, The Mummy's Ghost , looking for the mummy's remains. The swamp is being drained, and the archaeologists would like to take ownership of the mummy. But, as bad luck would have it, the mummy is still undead, and chaos ensues. Review The film is similar to not only the previous film , but also to the film prior to that , The Mummy's Tomb . I liked The Mummy's Tomb , but disliked The Mummy's Ghost . The small differences between each made a lot of difference in my enjoyment or lack thereof. And in the case of this film, I enjoyed it. Sure, it's mostly a repeat, but it moves along at a quick pace and there's some good acting and action. On the downside, there's a rather offensive stereotype in the film as well, and every time this character opened his mouth I both laughed and cringed. If  you watch the film, you'll know who I'm talking about. ...

Silent Renew and the "login_required" Error When Using oidc-client

I recently implemented the Silent Renew functionality of oidc-client in an Angular application I work on, and was getting reports that the users' tokens were still expiring. This made no sense to me as I'd verified the code was working during development, but yesterday I found the problem and am hoping it will save someone some time. The error we were getting back was "Error from signinSilent: login_required". This indicates that the user's session is no longer active on IdentityServer and they must re-authenticate -- which, of course, is what we're trying to prevent by using Silent Renew. In our case, the problem wasn't with the Silent Renew functionality, but rather the user's session was expired. The reason why  it was expired was because, for some reason, we were setting the session length to 15 minutes instead of the default 10 hours . What was occurring was that Silent Renew was attempting to renew a token after 55 minutes (60 minutes expirat...

Serving Your Angular CLI Apps Locally Over HTTPS

When running an Angular CLI app locally, it's easy to set it up to run over HTTPS to more accurately match how it would run in a secure production environment (rather than just running it over HTTP locally). The below approach works with Angular CLI 6 and above, but may also be available in earlier versions. In your angular.json file, look for your project in the projects  node and then find the serve  child node. Under that node, you can add a property called ssl  and set the value to true  to cause Angular CLI to build the project with a local SSL cert that it will create for you. "serve" : { "builder" : "@angular-devkit/build-angular:dev-server" , "options" : { "browserTarget" : "staff-portal-two:build" , "ssl" : true }, When you run ng serve  for the first time after adding this property, there will be some output on the command line regarding the certificate being created. Af...

Setting Up Your Angular CLI App to Generate Code Coverage Reports Any Time Tests Are Run in a Workspace with Multiple Projects

I currently do development in an Angular CLI application that contains multiple library projects, and recently enabled code coverage reports to be generated automatically every time unit tests were run. This consisted of 4 steps: Turn on code coverage for each project. Exclude the libraries from coverage in projects that utilized them (each library has its own coverage). Set the output directory for each project's code coverage report to a sub-directory of the code coverage directory to avoid overwriting files for each report generated. Make additions to ignore the code coverage directory from source control. Here's each of these steps in detail. Step 1: Turn on code coverage for each project In angular.json , go to the architect/test/options  node for each project and add a property called codeCoverage  if it's not already there. Set the value to true , as shown below: "test" : { "builder" : "@angular-devkit/build-angular:...

How to Set Who Gets Notified When a Data Extension Import Occurs in Marketing Cloud

Some time ago, I created a data extension in Marketing Cloud and somehow set up a way to get an email notification when one of our scheduled processes kicked of an import. But recently, for the life of me, I couldn't figure out how I set up the import notification part, and I was unable to find the setting in the Marketing Cloud UI. Finally, with a little Googling, and by narrowing down what I was searching by, I found it. Here's how you can set the email address to have the Data Extension Import Notification sent to.  Hopefully this can help someone else in the same situation. 1. From the main Marekting Cloud dashboard, select Contact Builder under the Audience Builder menu. (While I had been trying to figure all of this out I had been looking at the Data Extension configuration, and then tried looking for the Import Definition -- I couldn't image it would be under the Contact Builder  section.) 2. Select Imports from the top nav bar. 3. Find the import definition...

How To Set Up Extra Application Initialization in an Angular App

Image
Angular includes a constant called APP_INTIALIZER. As of the time of this writing, the Angular docs page on it looks like this: I'm pretty sure they've updated the page since the first time I looked at it, at which point it said even less than what is shown above. And even the expanded documentation above isn't exactly clear as to how to use this. So I'll elaborate. In your app's module file, you can declare a provider that provides APP_INITIALIZER . And you can tell it to use a certain function via the useFactory property. For example, in my app.module.ts, I import my environment constant which contains environment-specifc config settings, and I've declared a function called initializeApp()  which initializes my AppConfigService  with envrionment : import { environment } from '../environments/environment' ; export function initializeApp ( appConfigSvc : AppConfigService ) { return () => { appConfigSvc . init ( en...

Getting Moment.js to Work with Angular 6 and Higher

One of the reasons I blog here is so that I'll have an easy way to find things I needed to figure out, so that I don't need to figure them out again . And I really do need to keep that in mind. Today, a co-worker of mine asked me for help getting Moment.js to work with an application using Angular 7. Before I could find a solution, he found one already in the code in a different area. When I looked at the file in question, I'd written it (sigh). I didn't remember the problem (or the solution) until seeing the file again. At the time, I'd been trying to get Moment.js to work with Angular 6 . Here's the simple solution: //Moment doesn't want to behave in Angular 6. Here's the workaround. import * as moment_ from 'moment' ; const moment = moment_; And then you just the use moment  constant like this: Example: payload.birthDate = moment(profile.birthDate).toDate(); I think I probably found this solution on Stack Oveflow, so I c...