Skip to content

Commit cb03cac

Browse files
feature(ui): add react version (#236)
- Add react ui version - Fix error with authservice loggedin endpoint where it was not retrieving the user
1 parent 0071c51 commit cb03cac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+10946
-6
lines changed

.github/filters.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ auth-service: services/auth-service/nodejs/**
22
gateway: services/gateway/nodejs/**
33
training-service: services/training-service/nodejs/**
44
user-service: services/user-service/nodejs/**
5-
ui: services/ui/angular/**
5+
ui-angular: services/ui/angular/**
6+
ui-react: services/ui/react/**

.github/labeler.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ ui:
4040
- changed-files:
4141
- any-glob-to-any-file: 'services/ui/**/*'
4242

43+
react:
44+
- changed-files:
45+
- any-glob-to-any-file: 'services/ui/react/*'
46+
47+
angular:
48+
- changed-files:
49+
- any-glob-to-any-file: 'services/ui/angular/*'
50+
51+
4352
user-service:
4453
- changed-files:
4554
- any-glob-to-any-file: 'services/user-service/**/*'

.github/service-values.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ user-service:
1414
context: services/user-service/nodejs
1515
image: coveros/codeveros-user-service
1616

17-
ui:
17+
ui-angular:
1818
context: services/ui/angular
1919
image: coveros/codeveros-ui
20+
21+
ui-react:
22+
context: services/ui/react
23+
image: coveros/codeveros-ui-react

services/auth-service/nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codeveros/auth-service",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "Simple authentication back-end service",
55
"private": true,
66
"engines": {

services/gateway/nodejs/src/lib/authentication.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ module.exports = opts => {
135135

136136
if (tokenRes.ok) {
137137
const jwtPayload = await tokenRes.json();
138-
if (jwtPayload) {
139-
req.jwtPayload = jwtPayload;
138+
if (jwtPayload?.valid) {
139+
req.jwtPayload = jwtPayload.payload;
140140
return next();
141141
}
142142
}
@@ -150,7 +150,7 @@ module.exports = opts => {
150150
};
151151

152152
Authentication.loggedin = async (req, res) => {
153-
if (!req.jwtPayload) {
153+
if (!req.jwtPayload?._id) {
154154
return res.status(200).send();
155155
}
156156

services/ui/react/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default environment variables
2+
REACT_APP_API_URL=/api
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Local environment overrides
2+
# This file is gitignored and used for local development overrides
3+
# Copy this to .env.local and customize for your local setup
4+
5+
# Example: Different backend
6+
# REACT_APP_API_URL=http://different-host:9090/api

services/ui/react/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
reports

services/ui/react/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.17.1

services/ui/react/.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

0 commit comments

Comments
 (0)