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

Add application to auth token params #1167

Merged
merged 4 commits into from
Sep 5, 2024
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'"
},
"dependencies": {
"@accentor/api-client-js": "^0.20.1",
"@accentor/api-client-js": "^0.21.0",
"@mdi/font": "^7.4.47",
"@mdi/svg": "^7.4.47",
"fetch-retry": "^6.0.0",
Expand Down
7 changes: 6 additions & 1 deletion src/store/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ export default {
actions: {
async login({ commit }, data) {
try {
const result = await api.auth_tokens.create(data);
const result = await api.auth_tokens.create({
auth_token: {
application: process.env.APPLICATION_VERSION,
},
...data,
});
commit("login", result);
return true;
} catch (error) {
Expand Down
11 changes: 11 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const version = require("./package.json").version;
const webpack = require("webpack");

module.exports = {
pluginOptions: {
i18n: {
Expand All @@ -16,6 +19,14 @@ module.exports = {
},
configureWebpack: (config) => {
config.cache = process.env.SKIP_CACHE !== "true";
config.plugins.push(
new webpack.DefinePlugin({
"process.env": {
// When building, this value will just be printed without quotes, so we add them explicitly
APPLICATION_VERSION: `"Accentor Web v${version}"`,
},
}),
);
},
chainWebpack: (config) => {
config.module
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions yarn.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.