• Stars
    star
    461
  • Rank 91,434 (Top 2 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📱 An example React Native project for client login authentication

react-native-login

What is it?

react-native-login is an example React Native project showing how to use a WebView and react-native-cookies to login to your existing backend.

Using a server-side login template that you have already created, this project wraps it with a WebView and checks authentication status using react-native-cookies Once authenticated, a LoggedIn component is rendered showing the user they are authenticated. Cookies are persisted via the WebView so any other component you use that calls fetch() to retrieve AJAX data will also pass on this cookie!

Furthermore, upon opening the app after closing it, the user will stay signed in. When they touch the logout button, their cookies are cleared and they are subsequently redirected to the login component which lives in ./ReactNativeLogin/App/components/App.js

What else?

An example server, using Express and Passport is included within this project under the ./server folder. You can use any server though, just be sure to change cookie.remember_me to whatever the name for your persistent cookie is, within the ./ReactNativeLogin/App/components/App.js file. Follow the installation instructions to learn more.

Be sure to also change the URLs in App.js to reflect the URLs of your production and/or development server. For example, if you are running Android on Genymotion you will need to change this to the appropriate localhost IP address.

WORKS FOR ANDROID AND IOS 😄 YAY!

Requirements

Ensure that you have installed absolutely everything listed here

Installation

  1. git clone https://github.com/ryanmcdermott/react-native-login.git
  2. cd react-native-login/ReactNativeLogin
  3. npm install
  4. cd ../server
  5. npm install
  6. node server.js
  7. To run the iOS version, open another terminal window type open ../ReactNativeLogin/iOS/ReactNativeLogin.xcodeproj
  8. Click the play icon in Xcode to start the app

Contributing

Pull requests are much appreciated and accepted.

License

Released under the MIT License

Credits

Jared Hanson's excellent passport-remember me example

More Repositories

1

clean-code-javascript

🛁 Clean Code concepts adapted for JavaScript
JavaScript
89,557
star
2

code-review-tips

🔬 Common problems to look for in a code review
JavaScript
1,440
star
3

3rs-of-software-architecture

A guide on how to write readable, reusable, and refactorable software
JavaScript
1,038
star
4

trump-speeches

📄 1mb Archive of Donald Trump Speeches
175
star
5

birdseed

🐦 🎲 Use Twitter's Search API to get random numbers
Python
78
star
6

starmark

:octocat: Turn your GitHub stars into Chrome bookmarks
JavaScript
71
star
7

js-fp-algorithms

JavaScript algorithms, in a functional programming style
JavaScript
48
star
8

algorithms

Popular computer science algorithms implemented in Python
Python
46
star
9

katas

🏫 Coding katas
C++
44
star
10

terraform-microservices-example

Using Terraform to deploy microservices that communicate with each other
HCL
24
star
11

typed-arrays

🚀 Performance comparison of JavaScript TypedArrays and native Arrays
JavaScript
19
star
12

jekyll-latex

Jekyll theme with beautiful LaTeX typography
SCSS
17
star
13

docker-flask

👖 A simple Docker setup for a Flask application on Nginx
Dockerfile
13
star
14

trumpgen

Generate Donald Trump speeches using recurrent neural networks (RNNs)
Elm
9
star
15

dotfiles

💾 ...files
Vim Script
9
star
16

spotifind

🎵 Connect two musical artists by a chain of related artists using Spotify's API
Go
7
star
17

typescript-makefile

Quick and easy starting off point for a TypeScript project
TypeScript
6
star
18

lexical_vanilla

An actual vanilla JavaScript example of Lexical text editor
JavaScript
6
star
19

til

📕 Today I Learned
5
star
20

webvr-n-body

WebVR n-body galaxy simulation using Barnes-Hut Tree and AFrame powered by WebGL
TypeScript
5
star
21

esish

Recursive descent parser written in Rust for an ECMAScript inspired language.
Rust
5
star
22

node-boilerplate

A ridiculously simple starting point for a Node app
JavaScript
5
star
23

dumbkit

Toy Browser Engine
JavaScript
4
star
24

ryanmcdermott.github.io

My personal blog
SCSS
4
star
25

TextArmyKnife

A simple Python program for miscellaneous text processing
Python
3
star
26

really-simple-c

Really simple C compiler (RSCC), written in Rust
Rust
3
star
27

ette

Encrypted Text Terminal Editor (Ette)
C++
3
star
28

interpreter-typescript

Let's write an interpreter in TypeScript
TypeScript
3
star
29

gradle-dependency-example

Ridiculously simple example showing how you can use Gradle to install dependencies in Java and run programs using them
Java
3
star
30

vr-desk

💻 A WebVR experiment, join in!
JavaScript
3
star
31

golang-presentation

Golang Presentation for Austin Golang Meetup Jun 2015
2
star
32

bazel-java-template

Simple starter template for a Java project built with Bazel
Starlark
1
star
33

rules_cc_embed_data

Bazel rule to generate C++ header files with embedded binary data
Starlark
1
star
34

which-ride

🚗 Which Ride is an Uber and Lyft price comparison app -- http://whichride.herokuapp.com
Ruby
1
star
35

bazel-rust-template

Starlark
1
star
36

set-tools

Function extensions to supercharge JavaScript's Set type with common set operations
JavaScript
1
star
37

terraform-ec2-instance

Terraform file with everything you need to create an internet-facing EC2 instance.
HCL
1
star
38

rsvm

Really Simple Virtual Machine
Rust
1
star