-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joel Anton
committed
May 9, 2024
1 parent
6aded3a
commit c51c649
Showing
3 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './selectHasUserCompletedSignUp'; |
13 changes: 13 additions & 0 deletions
13
libs/shared-web/src/utils/auth-selectors/selectHasUserCompletedSignUp.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { UserContext } from '../../providers'; | ||
|
||
/** | ||
* Determine if a user is fully-registered; if not, they're still in onboarding. | ||
*/ | ||
export const selectHasUserCompletedSignUp = (userCtx: UserContext): boolean => { | ||
if (!userCtx) { | ||
return false; | ||
} | ||
|
||
// User has completed registration if they have an associated orgId. | ||
return !!userCtx.jwtPayload?.organizationId; | ||
}; |