tohu
23 Enero, 2020 09:09
3
Hay una aplicación de React Native que puedes usar como referencia para saber cómo iniciar sesión.
Este archivo en particular debería ayudarte a empezar.
'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