Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated kernel changes #508

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/backend/routes/views/account/get/connectSteam.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports = module.exports = function (req, res) {

request.post({
url: process.env.API_URL + '/users/buildSteamLinkUrl',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: { callbackUrl: req.protocol + '://' + req.get('host') + '/account/link?done' }
}, function (err, res, body) {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/routes/views/account/get/linkGog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports = module.exports = function (req, res) {

request.get({
url: process.env.API_URL + '/users/buildGogProfileToken',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: {}
}, function (err, res, body) {
locals.gogToken = 'unable to obtain token'
Expand Down
2 changes: 1 addition & 1 deletion src/backend/routes/views/account/get/resync.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports = module.exports = function (req, res) {

request.post({
url: process.env.API_URL + '/users/resyncAccount',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token }
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token }
}, function (err, res, body) {
if (err || res.statusCode !== 200) {
error.parseApiErrors(body, flash)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/routes/views/account/post/changeEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports = module.exports = function (req, res) {

request.post({
url: `${process.env.API_URL}/users/changeEmail`,
headers: { Authorization: `Bearer ${req.services.userService.getUser()?.oAuthPassport.token}` },
headers: { Authorization: `Bearer ${req.requestContainer.get('UserService').getUser()?.oAuthPassport.token}` },
form: { newEmail: email, currentPassword: password }
}, function (err, res, body) {
if (err || res.statusCode !== 200) {
Expand Down
6 changes: 2 additions & 4 deletions src/backend/routes/views/account/post/changePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@ exports = module.exports = function (req, res) {
// Encrypt password before sending it off to endpoint
const newPassword = req.body.password
const oldPassword = req.body.old_password
const username = req.body.username

const overallRes = res

// Run post to reset endpoint
request.post({
url: process.env.API_URL + '/users/changePassword',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
form: { name: username, currentPassword: oldPassword, newPassword }
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: { currentPassword: oldPassword, newPassword }
}, function (err, res, body) {
if (err || res.statusCode !== 200) {
error.parseApiErrors(body, flash)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/routes/views/account/post/changeUsername.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports = module.exports = function (req, res) {
// Run post to reset endpoint
request.post({
url: process.env.API_URL + '/users/changeUsername',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: { newUsername: username }
}, function (err, res, body) {
if (err || res.statusCode !== 200) {
Expand Down
4 changes: 2 additions & 2 deletions src/backend/routes/views/account/post/linkGog.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports = module.exports = function (req, res) {

request.post({
url: process.env.API_URL + '/users/linkToGog',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: { gogUsername }
}, function (err, res, body) {
if (!err && res.statusCode === 200) {
Expand All @@ -49,7 +49,7 @@ exports = module.exports = function (req, res) {
// it's not possible to extract it into a separate function while saving any code
request.get({
url: process.env.API_URL + '/users/buildGogProfileToken',
headers: { Authorization: 'Bearer ' + req.services.userService.getUser()?.oAuthPassport.token },
headers: { Authorization: 'Bearer ' + req.requestContainer.get('UserService').getUser()?.oAuthPassport.token },
form: {}
}, function (err, res, body) {
locals.gogToken = 'unable to obtain token'
Expand Down
1 change: 0 additions & 1 deletion src/backend/templates/views/account/changePassword.pug
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ block content
.row
.col-md-offset-3.col-md-6
form(method='post',action="/account/changePassword",data-toggle="validator")
+username
+oldPassword('Old')
+confirm-password('','New')
.form-actions
Expand Down