Commit migrated from dotnet/aspnetcore@5c6e1aa1d9
This commit is contained in:
Matheus Marques 2019-03-18 05:42:56 -03:00 коммит произвёл Javier Calvarro Nelson
Родитель 6884a7d97c
Коммит 2599383ae4
4 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -23,7 +23,7 @@ export default class App extends Component {
////#endif
////#if (IndividualLocalAuth)
<AuthorizeRoute path='/fetch-data' component={FetchData} />
<Route path={ApplicationPaths.ApiAuthorizationPrefix} Component={ApiAuthorizationRoutes} />
<Route path={ApplicationPaths.ApiAuthorizationPrefix} component={ApiAuthorizationRoutes} />
////#endif
</Layout>
);

Просмотреть файл

@ -56,7 +56,7 @@ export class FetchData extends Component {
async populateWeatherData() {
////#if (IndividualLocalAuth)
const token = authService.getAccessToken();
const token = await authService.getAccessToken();
const response = await fetch('api/SampleData/WeatherForecasts', {
headers: !token ? {} : { 'Authorization': `Bearer ${token}` }
});

Просмотреть файл

@ -24,7 +24,7 @@ const prefix = '/authentication';
export const ApplicationPaths = {
DefaultLoginRedirectPath: '/',
ApiAuthorizationClientConfigurationUrl: `/_configuration/${ApplicationName}`,
ApiAuthorizationPrefix = prefix,
ApiAuthorizationPrefix: prefix,
Login: `${prefix}/${LoginActions.Login}`,
LoginFailed: `${prefix}/${LoginActions.LoginFailed}`,
LoginCallback: `${prefix}/${LoginActions.LoginCallback}`,

Просмотреть файл

@ -1,7 +1,7 @@
import React, { Component, Fragment } from 'react';
import { Route } from 'react-router';
import { Login } from './components/api-authorization/Login'
import { Logout } from './components/api-authorization/Logout'
import { Login } from './Login'
import { Logout } from './Logout'
import { ApplicationPaths, LoginActions, LogoutActions } from './ApiAuthorizationConstants';
export default class ApiAuthorizationRoutes extends Component {