## AuthStore()

A mobx store responsible for holding the current access token, refresh token and userId in memory and in Expo's SecureStore. Used by Atlas

Constructor

#### # new AuthStore()

Constructor. Uses mobx's makeObservable to register actions and observable elements.

View Source src/stores/AuthStore.ts, line 9

# Members

#### # static this.accessToken

A string representing the OAuth2 access token issued to the user when they authenticate. It is sent in the Authorization header of all subsequent XHR requests in order to use authorized API endpoints. For more information on OAuth2 and OpenIdConnect, visit https://openid.net/connect/ and https://oauth.net/2/.

View Source src/stores/AuthStore.ts, line 19

#### # static this.refreshToken

A string representing the OAuth2 refresh token issued to the user when they authenticate. It is sent to the identity provider to retrieve a new access token when the previous access token expires.

View Source src/stores/AuthStore.ts, line 24

Type: string | null

#### # accessToken

A string representing the OAuth2 access token issued to the user when they authenticate. It is sent in the Authorization header of all subsequent XHR requests in order to use authorized API endpoints. For more information on OAuth2 and OpenIdConnect, visit https://openid.net/connect/ and https://oauth.net/2/.

View Source src/stores/AuthStore.ts, line 90

Type: string | null

#### # refreshToken

A string representing the OAuth2 refresh token issued to the user when they authenticate. It is sent to the identity provider to retrieve a new access token when the previous access token expires.

View Source src/stores/AuthStore.ts, line 96

#### # userId

A string representing the OAuth2 refresh token issued to the user when they authenticate. It is used to retrieve the users information from the API and to link objects created by the user to the user.

View Source src/stores/AuthStore.ts, line 28

Type: string

#### # userId

A string representing the OAuth2 refresh token issued to the user when they authenticate. It is used to retrieve the users information from the API and to link objects created by the user to the user.

View Source src/stores/AuthStore.ts, line 101

# Methods

#### # async setAccessTokenAsync()

Uses the given access token value to set `accessToken` and the 'access' element in the secure store.

View Source src/stores/AuthStore.ts, line 41

#### # async setIdAsync()

Uses the given user id value to set `userId` and the 'id' element in the secure store.

View Source src/stores/AuthStore.ts, line 65

#### # async setRefreshTokenAsync()

Uses the given refresh token value to set `refreshToken` and the 'refresh' element in the secure store.

View Source src/stores/AuthStore.ts, line 53