tohu
Janvier 23, 2020, 9:09
3
Il existe une application React Native que vous pouvez utiliser comme référence pour savoir comment vous connecter.
Ce fichier en particulier devrait vous aider à démarrer.
'use strict';
import {Platform} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
const site = 'https://' + global.siteDomain;
class Authenticate {
constructor() {}
login(username, password) {
return new Promise((resolve, reject) => {
this.getAbout()
.then((json) => {
// old version
if (json.about.version.startsWith('2.5')) {
this.getCSRF()
.then((json) => {
if (json.csrf) {
AsyncStorage.getItem('@Discourse.loginCookie').then(
(cookie) => {
This file has been truncated. show original