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
1 parent
af0f5e1
commit d3a7e36
Showing
2 changed files
with
12 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import Masa from "../masa"; | ||
|
||
export const checkAllowlist = async (masa: Masa): Promise<boolean> => { | ||
let loggedIn = false; | ||
export const checkAllowlist = async (masa: Masa): Promise<any> => { | ||
const checkAllowlistResponse = await masa.client.allowlistCheck(); | ||
if (checkAllowlistResponse) { | ||
console.log(`Allowlist enabled: ${checkAllowlistResponse.isActive}`); | ||
console.log(`Allowlist enabled until: ${checkAllowlistResponse.endDate}`); | ||
|
||
const checkSessionResponse = await masa.client.sessionCheck(); | ||
if (checkSessionResponse) { | ||
console.log(`User ID: '${checkSessionResponse.user.userId}'`); | ||
console.log(`Signer Address: '${await masa.config.wallet.getAddress()}'`); | ||
console.log("\n"); | ||
|
||
loggedIn = true; | ||
return checkAllowlistResponse; | ||
} | ||
|
||
return loggedIn; | ||
return null; | ||
}; |
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