小编Nik*_*nov的帖子

错误:状态 auth0 无效

我正在尝试按照本教程在我的 Angular 5 应用程序中实现 auth0: https: //toddmotto.com/angular-2-authentication

寄存器工作正常,但当我尝试登录时,我在控制台中看到以下内容:在此输入图像描述

这是我的身份验证服务:

import { Injectable } from '@angular/core';

// We want to avoid any 'name not found'
// warnings from TypeScript
declare var Auth0Lock: any;


@Injectable()
export class AuthService {
    private lock

    constructor() {
        // These stuff should be exported into other files
        this.lock = new Auth0Lock('id...',
            'url...')
    }

    login() {
        this.lock.show((error: string, profile: Object, id_token: string) => {
            if (error) {
                console.log(error);
            } else {
                console.log(profile)
                localStorage.setItem('profile', JSON.stringify(profile));
                localStorage.setItem('id_token', id_token);
            }
        }); …
Run Code Online (Sandbox Code Playgroud)

auth0 angular

3
推荐指数
1
解决办法
5413
查看次数

标签 统计

angular ×1

auth0 ×1