Skip to content

Commit

Permalink
Block registration usage when the user isn't logged in.
Browse files Browse the repository at this point in the history
  • Loading branch information
wparad committed Dec 13, 2023
1 parent 84f81b1 commit 17c1cb9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ class LoginClient {

async registerDevice(options = { name: '' }) {
const userIdentity = await this.getUserIdentity();
if (!userIdentity) {
const e = Error('User must be logged to configure user profile data.');
e.code = 'NotLoggedIn';
throw e;
}
const userId = userIdentity.sub;

// https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create
Expand Down

0 comments on commit 17c1cb9

Please sign in to comment.