@criipto/verify-expo
Version:
Accept MitID, NemID, Swedish BankID, Norwegian BankID and more logins in your Expo (React-Native) app
38 lines • 1.04 kB
JavaScript
import { createContext } from "react";
export const actions = ["confirm", "accept", "approve", "sign", "login"];
export class OAuth2Error extends Error {
error;
error_description;
state;
constructor(error, error_description, state) {
super(error + (error_description ? ` (${error_description})` : ""));
this.name = "OAuth2Error";
this.error = error;
this.error_description = error_description;
this.state = state;
}
}
export class UserCancelledError extends OAuth2Error {
constructor() {
super("access_denied", "User cancelled login");
this.name = "UserCancelledError";
}
}
/**
* @ignore
*/
const stub = () => {
throw new Error("You forgot to wrap your component in <CriiptoVerifyProvider>.");
};
/**
* @ignore
*/
const initialContext = {
login: stub,
logout: stub,
claims: null,
error: null,
};
const CriiptoVerifyContext = createContext(initialContext);
export default CriiptoVerifyContext;
//# sourceMappingURL=context.js.map