Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Acquire Token APIs Internally #792

Merged
merged 22 commits into from Jul 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 5 additions & 10 deletions lib/msal-core/src/Constants.ts
Expand Up @@ -82,6 +82,9 @@ export class Constants {

static get cacheLocationLocal(): CacheLocation { return "localStorage"; }
static get cacheLocationSession(): CacheLocation { return "sessionStorage"; }

static get interactionTypeRedirect(): InteractionType { return "redirectInteraction"; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to use an enum here

enum InteractionType {
    Redirect, 
    PopUp
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will keep this consistent with cache location for now, update to enums in a future PR

static get interactionTypePopup(): InteractionType { return "popupInteraction"; }
DarylThayil marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down Expand Up @@ -128,6 +131,8 @@ export const BlacklistedEQParams = [
SSOTypes.LOGIN_HINT
];

export type InteractionType = "redirectInteraction" | "popupInteraction";

/**
* we considered making this "enum" in the request instead of string, however it looks like the allowed list of
* prompt values kept changing over past couple of years. There are some undocumented prompt values for some
Expand All @@ -147,13 +152,3 @@ export const PromptState = {
export const Library = {
version: "1.0.2"
};

/**
* @hidden
* Readable shortcut for Interaction Required Errors
*/
export const InteractionErrorType = {
LOGIN: InteractionError.loginRequired.code,
CONSENT: InteractionError.consentRequired.code,
INTERACTION: InteractionError.interactionRequired.code
};