AuthStore.html 18 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title> AuthStore</title>
  7. <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
  8. <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
  9. <script src="./build/entry.js"></script>
  10. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  11. <!--[if lt IE 9]>
  12. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  13. <![endif]-->
  14. <link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
  15. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  16. <link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
  17. <link type="text/css" rel="stylesheet" href="styles/app.min.css">
  18. <link type="text/css" rel="stylesheet" href="styles/iframe.css">
  19. <link type="text/css" rel="stylesheet" href="">
  20. <script async defer src="https://buttons.github.io/buttons.js"></script>
  21. </head>
  22. <body class="layout small-header">
  23. <div id="stickyNavbarOverlay"></div>
  24. <div class="top-nav">
  25. <div class="inner">
  26. <a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
  27. <span aria-hidden="true"></span>
  28. <span aria-hidden="true"></span>
  29. <span aria-hidden="true"></span>
  30. </a>
  31. <div class="logo">
  32. </div>
  33. <div class="menu">
  34. <div class="navigation">
  35. <a
  36. href="index.html"
  37. class="link"
  38. >
  39. API Documentation
  40. </a>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div id="main">
  46. <div
  47. class="sidebar "
  48. id="sidebarNav"
  49. >
  50. <nav>
  51. <h2><a href="index.html">Documentation</a></h2><div class="category"><h3>Interfaces</h3><ul><li><a href="AddLandmarkProps.html">AddLandmarkProps</a></li><li><a href="CommentProps.html">CommentProps</a></li><li><a href="IdToken.html">IdToken</a></li><li><a href="IntroProps.html">IntroProps</a></li><li><a href="Landmark.html">Landmark</a></li><li><a href="LandmarkDetailsProps.html">LandmarkDetailsProps</a></li><li><a href="LandmarkPinProps.html">LandmarkPinProps</a></li><li><a href="LMComment.html">LMComment</a></li><li><a href="ProfileProps.html">ProfileProps</a></li><li><a href="RegisterProps.html">RegisterProps</a></li><li><a href="UserProfile.html">UserProfile</a></li></ul><h3>Components</h3><ul><li><a href="App.html">App</a></li><li><a href="Atlas.html">Atlas</a></li><li><a href="Comment.html">Comment</a></li><li><a href="PrimaryButton.html">PrimaryButton</a></li><li><a href="Profile.html">Profile</a></li><li><a href="SecondaryButton.html">SecondaryButton</a></li></ul><h3>Global</h3><ul><li><a href="global.html#IconStrings">IconStrings</a></li></ul></div><div class="category"><h2>Hooks</h2><h3>Namespaces</h3><ul><li><a href="useAuth.html">useAuth</a></li><li><a href="useLandmarks.html">useLandmarks</a></li><li><a href="useProfile.html">useProfile</a></li></ul></div><div class="category"><h2>Map</h2><h3>Interfaces</h3><ul><li><a href="UserLocation.html">UserLocation</a></li></ul><h3>Components</h3><ul><li><a href="AddLandmark.html">AddLandmark</a></li><li><a href="LandmarkDetails.html">LandmarkDetails</a></li><li><a href="LandmarkPin.html">LandmarkPin</a></li><li><a href="Map.html">Map</a></li></ul></div><div class="category"><h2>Navigation</h2><h3>Components</h3><ul><li><a href="AuthorizedNavigator.html">AuthorizedNavigator</a></li><li><a href="UnauthorizedNavigator.html">UnauthorizedNavigator</a></li></ul><h3><a href="global.html">Global</a></h3></div><div class="category"><h2>Stores</h2><h3>Classes</h3><ul><li><a href="AuthStore.html">AuthStore</a></li></ul></div><div class="category"><h2>Unauthorized</h2><h3>Components</h3><ul><li><a href="Intro.html">Intro</a></li><li><a href="UnauthorizedLayout.html">UnauthorizedLayout</a></li></ul><h3>Components / Registration</h3><ul><li><a href="RegisterMain.html">RegisterMain</a></li></ul></div>
  52. </nav>
  53. </div>
  54. <div class="core" id="main-content-wrapper">
  55. <div class="content">
  56. <header class="page-title">
  57. <p>Class</p>
  58. <h1>AuthStore</h1>
  59. </header>
  60. <section>
  61. <header>
  62. <h2><span class="attribs"><span class="type-signature"></span></span>AuthStore<span class="signature">()</span><span class="type-signature"></span></h2>
  63. <div class="class-description"><p>A mobx store responsible for holding the current access token, refresh token and userId in memory and in Expo's <a href="https://docs.expo.dev/versions/latest/sdk/securestore/">SecureStore</a>.
  64. Used by <a href="Atlas.html">Atlas</a></p></div>
  65. </header>
  66. <article>
  67. <div class="container-overview">
  68. <div class='vertical-section'>
  69. <div class="members">
  70. <div class="member">
  71. <div class=name>
  72. <span class="tag">Constructor</span>
  73. </div>
  74. <h4 class="name" id="AuthStore">
  75. <a class="href-link" href="#AuthStore">#</a>
  76. <span class="code-name">
  77. new AuthStore<span class="signature">()</span><span class="type-signature"></span>
  78. </span>
  79. </h4>
  80. <div class="description">
  81. <p>Constructor. Uses mobx's <a href="https://mobx.js.org/observable-state.html">makeObservable</a> to register actions and observable elements.</p>
  82. </div>
  83. <dl class="details">
  84. <p class="tag-source">
  85. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  86. <span>
  87. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line9">line 9</a>
  88. </span>
  89. </p>
  90. </dl>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class='vertical-section'>
  96. <h1>Members</h1>
  97. <div class="members">
  98. <div class="member">
  99. <h4 class="name" id=".this.accessToken">
  100. <a class="href-link" href="#.this.accessToken">#</a>
  101. <span class='tag'>static</span>
  102. <span class="code-name">
  103. this.accessToken
  104. </span>
  105. </h4>
  106. <div class="description">
  107. <p>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.
  108. For more information on OAuth2 and OpenIdConnect, visit <a href="https://openid.net/connect/">https://openid.net/connect/</a> and <a href="https://oauth.net/2/">https://oauth.net/2/</a>.</p>
  109. </div>
  110. <dl class="details">
  111. <p class="tag-source">
  112. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  113. <span>
  114. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line19">line 19</a>
  115. </span>
  116. </p>
  117. </dl>
  118. </div>
  119. <div class="member">
  120. <h4 class="name" id=".this.refreshToken">
  121. <a class="href-link" href="#.this.refreshToken">#</a>
  122. <span class='tag'>static</span>
  123. <span class="code-name">
  124. this.refreshToken
  125. </span>
  126. </h4>
  127. <div class="description">
  128. <p>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.</p>
  129. </div>
  130. <dl class="details">
  131. <p class="tag-source">
  132. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  133. <span>
  134. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line24">line 24</a>
  135. </span>
  136. </p>
  137. </dl>
  138. </div>
  139. <div class="member">
  140. <span class="method-parameter is-pulled-right">
  141. <label>Type:</label>
  142. <span class="param-type">string</span>
  143. |
  144. <span class="param-type">null</span>
  145. </span>
  146. <h4 class="name" id="accessToken">
  147. <a class="href-link" href="#accessToken">#</a>
  148. <span class="code-name">
  149. accessToken
  150. </span>
  151. </h4>
  152. <div class="description">
  153. <p>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.
  154. For more information on OAuth2 and OpenIdConnect, visit <a href="https://openid.net/connect/">https://openid.net/connect/</a> and <a href="https://oauth.net/2/">https://oauth.net/2/</a>.</p>
  155. </div>
  156. <dl class="details">
  157. <p class="tag-source">
  158. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  159. <span>
  160. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line90">line 90</a>
  161. </span>
  162. </p>
  163. </dl>
  164. </div>
  165. <div class="member">
  166. <span class="method-parameter is-pulled-right">
  167. <label>Type:</label>
  168. <span class="param-type">string</span>
  169. |
  170. <span class="param-type">null</span>
  171. </span>
  172. <h4 class="name" id="refreshToken">
  173. <a class="href-link" href="#refreshToken">#</a>
  174. <span class="code-name">
  175. refreshToken
  176. </span>
  177. </h4>
  178. <div class="description">
  179. <p>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.</p>
  180. </div>
  181. <dl class="details">
  182. <p class="tag-source">
  183. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  184. <span>
  185. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line96">line 96</a>
  186. </span>
  187. </p>
  188. </dl>
  189. </div>
  190. <div class="member">
  191. <h4 class="name" id="userId">
  192. <a class="href-link" href="#userId">#</a>
  193. <span class="code-name">
  194. userId
  195. </span>
  196. </h4>
  197. <div class="description">
  198. <p>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.</p>
  199. </div>
  200. <dl class="details">
  201. <p class="tag-source">
  202. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  203. <span>
  204. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line28">line 28</a>
  205. </span>
  206. </p>
  207. </dl>
  208. </div>
  209. <div class="member">
  210. <span class="method-parameter is-pulled-right">
  211. <label>Type:</label>
  212. <span class="param-type">string</span>
  213. </span>
  214. <h4 class="name" id="userId">
  215. <a class="href-link" href="#userId">#</a>
  216. <span class="code-name">
  217. userId
  218. </span>
  219. </h4>
  220. <div class="description">
  221. <p>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.</p>
  222. </div>
  223. <dl class="details">
  224. <p class="tag-source">
  225. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  226. <span>
  227. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line101">line 101</a>
  228. </span>
  229. </p>
  230. </dl>
  231. </div>
  232. </div>
  233. </div>
  234. <div class='vertical-section'>
  235. <h1>Methods</h1>
  236. <div class="members">
  237. <div class="member">
  238. <h4 class="name" id="setAccessTokenAsync">
  239. <a class="href-link" href="#setAccessTokenAsync">#</a>
  240. <span class='tag'>async</span>
  241. <span class="code-name">
  242. setAccessTokenAsync<span class="signature">()</span><span class="type-signature"></span>
  243. </span>
  244. </h4>
  245. <div class="description">
  246. <p>Uses the given access token value to set <code>accessToken</code> and the 'access' element in the secure store.</p>
  247. </div>
  248. <dl class="details">
  249. <p class="tag-source">
  250. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  251. <span>
  252. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line41">line 41</a>
  253. </span>
  254. </p>
  255. </dl>
  256. </div>
  257. <div class="member">
  258. <h4 class="name" id="setIdAsync">
  259. <a class="href-link" href="#setIdAsync">#</a>
  260. <span class='tag'>async</span>
  261. <span class="code-name">
  262. setIdAsync<span class="signature">()</span><span class="type-signature"></span>
  263. </span>
  264. </h4>
  265. <div class="description">
  266. <p>Uses the given user id value to set <code>userId</code> and the 'id' element in the secure store.</p>
  267. </div>
  268. <dl class="details">
  269. <p class="tag-source">
  270. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  271. <span>
  272. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line65">line 65</a>
  273. </span>
  274. </p>
  275. </dl>
  276. </div>
  277. <div class="member">
  278. <h4 class="name" id="setRefreshTokenAsync">
  279. <a class="href-link" href="#setRefreshTokenAsync">#</a>
  280. <span class='tag'>async</span>
  281. <span class="code-name">
  282. setRefreshTokenAsync<span class="signature">()</span><span class="type-signature"></span>
  283. </span>
  284. </h4>
  285. <div class="description">
  286. <p>Uses the given refresh token value to set <code>refreshToken</code> and the 'refresh' element in the secure store.</p>
  287. </div>
  288. <dl class="details">
  289. <p class="tag-source">
  290. <a href="src_stores_AuthStore.ts.html" class="button">View Source</a>
  291. <span>
  292. <a href="src_stores_AuthStore.ts.html">src/stores/AuthStore.ts</a>, <a href="src_stores_AuthStore.ts.html#line53">line 53</a>
  293. </span>
  294. </p>
  295. </dl>
  296. </div>
  297. </div>
  298. </div>
  299. </article>
  300. </section>
  301. </div>
  302. <footer class="footer">
  303. <div class="content has-text-centered">
  304. <p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.7</a></p>
  305. <p class="sidebar-created-by">
  306. <a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
  307. <a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
  308. </p>
  309. </div>
  310. </footer>
  311. </div>
  312. <div id="side-nav" class="side-nav">
  313. </div>
  314. </div>
  315. <script src="scripts/app.min.js"></script>
  316. <script>PR.prettyPrint();</script>
  317. <script src="scripts/linenumber.js"> </script>
  318. </body>
  319. </html>