UNPKG

@sneko/ionic-appauth

Version:

Intergration for OpenId/AppAuth-JS into Ionic V3/4/5

88 lines (87 loc) 3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AuthActionBuilder = exports.AuthActions = void 0; var AuthActions; (function (AuthActions) { AuthActions["Default"] = "Default"; AuthActions["SignInSuccess"] = "Sign In Success"; AuthActions["SignInFailed"] = "Sign In Failed"; AuthActions["SignOutSuccess"] = "Sign Out Success"; AuthActions["SignOutFailed"] = "Sign Out Failed"; AuthActions["RefreshSuccess"] = "Refresh Success"; AuthActions["RefreshFailed"] = "Refesh Failed"; AuthActions["LoadTokenFromStorageSuccess"] = "Get Token From Storage Success"; AuthActions["LoadTokenFromStorageFailed"] = "Get Token From Storage Failed"; AuthActions["LoadUserInfoSuccess"] = "Load User Info Success"; AuthActions["LoadUserInfoFailed"] = "Load User Info Failed"; })(AuthActions = exports.AuthActions || (exports.AuthActions = {})); var AuthActionBuilder = /** @class */ (function () { function AuthActionBuilder() { } AuthActionBuilder.Default = function () { return { action: AuthActions.Default, }; }; AuthActionBuilder.SignOutSuccess = function () { return { action: AuthActions.SignOutSuccess, }; }; AuthActionBuilder.SignOutFailed = function (error) { return { action: AuthActions.SignOutFailed, error: error.message }; }; AuthActionBuilder.RefreshSuccess = function (tokenResponse) { return { action: AuthActions.RefreshSuccess, tokenResponse: tokenResponse }; }; AuthActionBuilder.RefreshFailed = function (error) { return { action: AuthActions.RefreshFailed, error: error.message, }; }; AuthActionBuilder.SignInSuccess = function (tokenResponse) { return { action: AuthActions.SignInSuccess, tokenResponse: tokenResponse }; }; AuthActionBuilder.SignInFailed = function (error) { return { action: AuthActions.SignInFailed, error: error.message }; }; AuthActionBuilder.LoadTokenFromStorageSuccess = function (tokenResponse) { return { action: AuthActions.LoadTokenFromStorageSuccess, tokenResponse: tokenResponse }; }; AuthActionBuilder.LoadTokenFromStorageFailed = function (error) { return { action: AuthActions.LoadTokenFromStorageFailed, error: error.message }; }; AuthActionBuilder.LoadUserInfoSuccess = function (user) { return { action: AuthActions.LoadUserInfoSuccess, user: user }; }; AuthActionBuilder.LoadUserInfoFailed = function (error) { return { action: AuthActions.LoadUserInfoFailed, error: error.message }; }; return AuthActionBuilder; }()); exports.AuthActionBuilder = AuthActionBuilder;