GithubHelp home page GithubHelp logo

keithdmoore / ionic-http-auth Goto Github PK

View Code? Open in Web Editor NEW
128.0 15.0 56.0 5.21 MB

An ionic-starter-project to show how the angular-http-auth library can be used for authentication.

JavaScript 47.01% Objective-C 27.11% C++ 6.49% C# 6.80% Java 6.51% CSS 1.11% HTML 4.98%

ionic-http-auth's Introduction

ionic-http-auth

An ionic-starter-project to show how the angular-http-auth library can be used for authentication.

The main intention of this project is to showcase a side menu ionic starter app that uses the angular-http-auth library to intercept http requests that respond with a 401 status. The user will then be prompted to login. Once a successful login occurs, the previous http request will be resubmitted with an authorization token on the header. The application flow will continue as if the user had been logged in the whole time.

You can follow the instructions below to build the app properly. Or if you want, you can just do this:

  1. Download the project
  2. npm install
  3. ionic serve
  4. Access http://localhost:8100
  5. Follow the instructions on the "Home" page.

Ionic App Base

A starting project for Ionic that optionally supports using custom SCSS.

Using this project

We recommend using the ionic utility to create new Ionic projects that are based on this project but use a ready-made starter template.

For example, to start a new Ionic project with the default tabs interface, make sure the ionic utility is installed:

$ sudo npm install -g ionic

Then run:

$ sudo npm install -g ionic
$ ionic start myProject tabs

More info on this can be found on the Ionic Getting Started page.

Installation

While we recommend using the ionic utility to create new Ionic projects, you can use this repo as a barebones starting point to your next Ionic app.

To use this project as is, first clone the repo from GitHub, then run:

$ cd ionic-app-base
$ sudo npm install -g cordova ionic gulp
$ npm install
$ gulp init

Using Sass (optional)

This project makes it easy to use Sass (the SCSS syntax) in your projects. This enables you to override styles from Ionic, and benefit from Sass's great features.

Just update the ./scss/ionic.app.scss file, and run gulp or gulp watch to rebuild the CSS files for Ionic.

Note: if you choose to use the Sass method, make sure to remove the included ionic.css file in index.html, and then uncomment the include to your ionic.app.css file which now contains all your Sass code and Ionic itself:

<!-- IF using Sass (run gulp sass first), then remove the CSS include above
<link href="css/ionic.app.css" rel="stylesheet">
-->

ionic-http-auth's People

Contributors

frederickjansen avatar keithdmoore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ionic-http-auth's Issues

How to make the login persistence

Hi @keithdmoore I came across here from your great post.

The login and logout flow worked really well, but I was wondering how can I make the login status persistence.

I've checked your code, but I don't see any place that store the user token, it's in memory I believe.

But in most case of a mobile client, user may not want to input their username and password every time when reopen the app.

In my app, I store the token in the localStorage, but I'm not sure whether this is the right way to do it, or something else like cookie?

Do you have any idea about this?

PS: I don't see much issue here and I'm not sure this is the right place to raise the question. Hope this won't trouble you. :D

Authentication for a New view

I want to add a new view (Suppose Search). and want to integrate authentication to that. How can I validate teh view for authentication. Can you guide me on this. I tried integrating it with Home page view also and unable to do so.

I want a system where all pages needs to be authenticated for valid login. Plz help me in this.

lib folder not found

in index.html there are

script src="lib/ionic/release/js/ionic.bundle.js"
script src="lib/angular-mocks/angular-mocks.js"
script src="lib/angular-local-storage/dist/angular-local-storage.js"

there is no lib file how could check app.please help me.(* I am new to ionic and angular JS)

Start

I'm having trouble to init this server, when i type npm install :
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the ionic-project package,
npm ERR! not with npm itself.

and a blank page appears when i run the ionic serve.

Darwin issue 14.1.0 issue

I ran into this issue when i put npm install. How I can fix this?

[email protected] preinstall /Users/yumiko/Desktop/yumiko/maidgency/ionic-http-auth
npm install -g cordova ionic gulp bower

npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "cordova" "ionic" "gulp" "bower"
npm ERR! node v0.12.2
npm ERR! npm v2.7.5
npm ERR! path /usr/local/lib/node_modules/ionic/.gitattributes
npm ERR! code EACCES
npm ERR! errno -13

Missing JS files

Hi there when i run npm install, the angular dependencies aren't fetched so on ionic serve i get js errors due to missing files :

  • /lib/angular-mocks/angular-mocks.js
  • /lib/angular-local-storage/dist/angular-local-storage.js
  • /lib/angular-http-auth/src/http-auth-interceptor.js

Would you have any idea what is going wrong ?

PS: I could just add them manually...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.