Compare commits
No commits in common. "8dae8adfbe8e5e2676f45a3f066a75c216f4e8c6" and "7672dd109ded059b9c9d2089d98d0bfc4c375c48" have entirely different histories.
8dae8adfbe
...
7672dd109d
4 changed files with 12 additions and 17 deletions
|
|
@ -4,12 +4,6 @@ Ce fichier permet de regrouper les différentes informations sur des décisions
|
|||
|
||||
Ces notes pouvant évoluer dans le temps, leur date d'écriture est aussi indiquée.
|
||||
|
||||
## _2020-10-07_ | react-native-keychain
|
||||
|
||||
Bloquée en 4.0.5 à cause d'un problème de performances. Au dessus de cette version, la récupération du token prend plusieurs secondes, ce qui n'est pas acceptable.
|
||||
|
||||
[Référence](https://github.com/oblador/react-native-keychain/issues/337)
|
||||
|
||||
## _2020-09-24_ | Flow
|
||||
|
||||
Flow est un système d'annotation permettant de rendre JavaScript typé statique. Développée par Facebook, cette technologie à initialement été adoptée. En revanche, de nombreux problèmes sont apparus :
|
||||
|
|
|
|||
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "campus",
|
||||
"version": "4.1.0",
|
||||
"version": "4.0.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
@ -9756,9 +9756,9 @@
|
|||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
|
||||
},
|
||||
"node-int64": {
|
||||
"version": "0.4.0",
|
||||
|
|
@ -10751,9 +10751,9 @@
|
|||
"integrity": "sha512-/VbpIEp8tSNNHIvstuA3Swx610whci1Zpc9mqNkqn14DkMbw+ORviln2u0XyHG1kPvvwTNGZY6QpeFwxYaSdbQ=="
|
||||
},
|
||||
"react-native-keychain": {
|
||||
"version": "4.0.5",
|
||||
"resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-4.0.5.tgz",
|
||||
"integrity": "sha512-TbiO8AO055EPjaxIuKxrCEOB4r81uQCVDFbtcs+e4pEOHxf6z3JgDC0UU0poJElKfCh37b+TFRxQhg6DbsYJBA=="
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-6.2.0.tgz",
|
||||
"integrity": "sha512-U6fnOQRJPq+c0Abl+FoYy9v0H3kQU587tMamU/o+MoBSUScFLE3DQpkyT1PW4NF5IObgiGuqQdmjC2KgtBpjGA=="
|
||||
},
|
||||
"react-native-linear-gradient": {
|
||||
"version": "2.5.6",
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
"react-native-collapsible": "^1.5.3",
|
||||
"react-native-gesture-handler": "^1.8.0",
|
||||
"react-native-image-zoom-viewer": "^3.0.1",
|
||||
"react-native-keychain": "4.0.5",
|
||||
"react-native-keychain": "^6.2.0",
|
||||
"react-native-linear-gradient": "^2.5.6",
|
||||
"react-native-localize": "^1.4.1",
|
||||
"react-native-modalize": "^2.0.6",
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ import {apiRequest, ERROR_TYPE} from '../utils/WebData';
|
|||
* 500 : SERVER_ERROR -> pb coté serveur
|
||||
*/
|
||||
|
||||
const SERVER_NAME = 'amicale-insat.fr';
|
||||
const AUTH_PATH = 'password';
|
||||
|
||||
export default class ConnectionManager {
|
||||
|
|
@ -77,7 +78,7 @@ export default class ConnectionManager {
|
|||
if (token != null) {
|
||||
resolve();
|
||||
} else {
|
||||
Keychain.getGenericPassword()
|
||||
Keychain.getInternetCredentials(SERVER_NAME)
|
||||
.then((data: Keychain.UserCredentials | false) => {
|
||||
if (data && data.password != null) {
|
||||
this.token = data.password;
|
||||
|
|
@ -107,7 +108,7 @@ export default class ConnectionManager {
|
|||
*/
|
||||
async saveLogin(email: string, token: string): Promise<void> {
|
||||
return new Promise((resolve: () => void, reject: () => void) => {
|
||||
Keychain.setGenericPassword('token', token)
|
||||
Keychain.setInternetCredentials(SERVER_NAME, 'token', token)
|
||||
.then(() => {
|
||||
this.token = token;
|
||||
resolve();
|
||||
|
|
@ -123,7 +124,7 @@ export default class ConnectionManager {
|
|||
*/
|
||||
async disconnect(): Promise<void> {
|
||||
return new Promise((resolve: () => void, reject: () => void) => {
|
||||
Keychain.resetGenericPassword()
|
||||
Keychain.resetInternetCredentials(SERVER_NAME)
|
||||
.then(() => {
|
||||
this.token = null;
|
||||
resolve();
|
||||
|
|
|
|||
Loading…
Reference in a new issue