ddomingues / angular2-devise-token-auth Goto Github PK
View Code? Open in Web Editor NEWHelper library for working with Devise Token Auth in your Angular 2 applications
Helper library for working with Devise Token Auth in your Angular 2 applications
Hi!
Tried to use this with Ionic2/Angular2 project. When running app in browser getting the next error:
reflective_provider.js:163
Uncaught Invalid provider - only instances of Provider and Type are allowed, got: [object Object]
Here is my app.ts
file:
import { Component, ViewChild } from '@angular/core';
import { AUTH_PROVIDERS, authService } from 'angular2-devise-token-auth';
import { HTTP_PROVIDERS } from '@angular/http';
import { App, ionicBootstrap, Platform, Nav } from 'ionic-angular';
import { StatusBar } from 'ionic-native';
...
@Component({
templateUrl: 'build/app.html'
})
class MyApp {
@ViewChild(Nav) nav: Nav;
...
constructor(private platform: Platform) {
this.initializeApp();
...
}
initializeApp() {
...
}
}
ionicBootstrap(MyApp, [HTTP_PROVIDERS, AUTH_PROVIDERS]);
Here is a part of reflective_provider.js
file that falls with error:
exports.mergeResolvedReflectiveProviders = mergeResolvedReflectiveProviders;
function _normalizeProviders(providers, res) {
providers.forEach(function (b) {
if (b instanceof lang_1.Type) {
res.push(provider_1.provide(b, { useClass: b }));
}
else if (b instanceof provider_1.Provider) {
res.push(b);
}
else if (provider_util_1.isProviderLiteral(b)) {
res.push(provider_util_1.createProvider(b));
}
else if (b instanceof Array) {
_normalizeProviders(b, res);
}
else if (b instanceof provider_1.ProviderBuilder) {
throw new reflective_exceptions_1.InvalidProviderError(b.token);
}
else {
>>> throw new reflective_exceptions_1.InvalidProviderError(b); // LINE 163
}
});
return res;
}
Any ideas?
Hey there. It is broken while installing, just take a look:
npm ERR! Tell the author that this fails on your system:
npm ERR! typings install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular2-devise-token-auth
Hey, im wondering how it works. I can sign in and get a 200 back, so it was successfull. But after that when i do a authHttp.get(url) on a url with authenticated_user! the authentication is restricted. Can you explain how it works?
What the point of this test if we provide AuthHttp with Http dependency, and not substitute Http with AuthHttp?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.