MCPcopy Create free account
hub / github.com/Packstack-Tech/packstack / constructor

Method constructor

frontend/src/AppContext.tsx:49–64  ·  view source on GitHub ↗
(props: AppProviderProps)

Source from the content-addressed store, hash-verified

47 token: TokenInterface;
48
49 constructor(props: AppProviderProps) {
50 super(props);
51 this.token = props.token != null ? props.token : new Token();
52 this.state = {
53 api: new Api(new Token()),
54 jwt: {
55 decoded: this.token.getDecoded(),
56 auth_token: this.token.getString()
57 },
58 userInfo: null,
59 categories: [],
60 setAuthToken: this.setAuthToken,
61 fetchUser: this.fetchUser,
62 logout: this.logout
63 };
64 }
65
66 componentDidMount() {
67 if (this.state.jwt.auth_token.length > 0) {

Callers

nothing calls this directly

Calls 2

getDecodedMethod · 0.80
getStringMethod · 0.80

Tested by

no test coverage detected