Skip to content

Commit

Permalink
New version 1.0.3 (#51)
Browse files Browse the repository at this point in the history
* Update version

* Add auth expire check

* Add linux build script and update installer scripts

* auth and UI bug fix

* update electron version for dynamically change top bar (#37)

* Update: Electron version to 7.0.0
* Add: Operating system dark mode support
* Update: Private notes size is enlarged

* add menu item became singular

* fix import function (#38)

* Fix import bug after electron update to 7.0.0

* Fix openexternal link issue and add success callback to paddle upgrade

* Refactor copy content functions

* Add detail mixin and implement for all detail pages

* Fix server detail page

* update servers

* Improve search function

* pre-release

* change company logo at detail and create

* added Generate tooltip

* Add custom title bar

* Implement a global search on the title bar

* added closeDevTools

* Update login page style

* fix height

* Fix title-bar drag issue

* added server field

* Update login page

* Fix quit issue

* update version 1.0.2

* add nvm usage to README

* Update electron and axios

* updated electron version

* fix top bar links

* removed paddle script

* add http cookie authentication

* fix check update url

* update version to 1.0.3

* Bump path-parse from 1.0.6 to 1.0.7 (#50)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump dns-packet from 1.3.1 to 1.3.4 (#49)

Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](mafintosh/dns-packet@v1.3.1...v1.3.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump hosted-git-info from 2.8.8 to 2.8.9 (#48)

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](npm/hosted-git-info@v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* upgrade electron builder version for mac arm

* update readme for build

Co-authored-by: Oguzhan INAN <[email protected]>
Co-authored-by: Faruk Oruç <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 2, 2021
1 parent 6bee8e2 commit 4bbf276
Show file tree
Hide file tree
Showing 9 changed files with 1,306 additions and 790 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,24 @@ yarn run dev

# build electron application for production
yarn run build
```

### Build From Source Code
After installing yarn, you can download dependencies and run the app with the commands below.

``` bash
# auto choose platform and architecture
yarn build

# MacOS x64 (intel)
yarn build --mac --x64

# MacOS arm64 (M1)
yarn build --mac --arm64

# Linux Debian Package
yarn build --linux deb

# Windows x64
yarn build --win --x64
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passwall",
"version": "1.0.2",
"version": "1.0.3",
"author": "PassWall <[email protected]>",
"description": "PassWall Desktop",
"license": "MIT",
Expand Down Expand Up @@ -99,7 +99,7 @@
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^11.4.1",
"electron-builder": "21.2.0",
"electron-builder": "22.10",
"electron-debug": "^1.5.0",
"electron-devtools-installer": "^2.2.4",
"electron-packager": "^15.0.0",
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<button class="btn-max" @click="onClickMax" />
</div>
<!-- Search -->
<div class="app-header-search" v-if="access_token">
<div class="app-header-search" v-if="authenticated">
<div class="app-header-search-wrapper">
<input
type="text"
Expand All @@ -20,7 +20,7 @@
</div>
</div>
<!-- Right Section -->
<div class="app-header-right-section" v-if="access_token">
<div class="app-header-right-section" v-if="authenticated">
<!-- Import -->
<button class="c-gray-300 mr-5" @click="onImport">
{{ $t('Import') }}
Expand Down Expand Up @@ -54,7 +54,7 @@ import { mapActions, mapMutations, mapState } from 'vuex'
import CryptoUtils from '@/utils/crypto'
export default {
computed: mapState(['access_token', 'searchQuery']),
computed: mapState(['authenticated', 'searchQuery']),
methods: {
...mapActions(['Import', 'Export', 'Logout']),
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/api/HTTPClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const client = Axios.create({
headers: {
'Content-Type': 'application/json; charset=utf-8',
Accept: 'application/json, text/plain, */*'
}
},
withCredentials: true,
})

export default class HTTPClient {
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/api/services/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export default class AuthService {
return HTTPClient.post(`/auth/signin`, payload)
}

static async Logout(payload) {
return HTTPClient.post(`/auth/signout`, payload)
}

static async Check(payload) {
return HTTPClient.post('/auth/check', payload)
}
Expand Down
23 changes: 13 additions & 10 deletions src/renderer/router/auth-check.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import store from '@/store';

export default (to, from, next) => {

const isAuthPage = to.matched.some(record => record.meta.auth)
const access_token = localStorage.getItem('access_token')
if (access_token) {
if (isAuthPage) {
return next({ name: 'Home' })
}

const isAuthenticated = store.getters['isAuthenticated']
if (isAuthenticated) {
if (isAuthPage) {
return next({ name: 'Home' })
}
} else {
if (!isAuthPage) {
return next({ name: 'Login' })
}
if (!isAuthPage) {
return next({ name: 'Login' })
}
}
next()
}
}
27 changes: 15 additions & 12 deletions src/renderer/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ export default new Vuex.Store({
CryptoUtils.transmissionKey = localStorage.transmission_key

return {
access_token: localStorage.access_token,
refresh_token: localStorage.refresh_token,
transmission_key: localStorage.transmission_key,
master_hash: localStorage.master_hash,
searchQuery: '',
authenticated: false,
pro: false,
user: {}
}
},

getters: {
hasProPlan(state) {
return state.user.type == 'pro'
return state.pro
},

isAuthenticated(state) {
return state.authenticated
}
},

Expand All @@ -41,34 +45,33 @@ export default new Vuex.Store({
payload.master_password = CryptoUtils.sha256Encrypt(payload.master_password)

const { data } = await AuthService.Login(payload)
state.access_token = data.access_token
state.refresh_token = data.refresh_token
state.transmission_key = data.transmission_key.substr(0, 32)
state.transmission_key = data.transmission_key
state.master_hash = CryptoUtils.pbkdf2Encrypt(data.secret, payload.master_password)
CryptoUtils.encryptKey = state.master_hash
CryptoUtils.transmissionKey = state.transmission_key
state.user = data
state.pro = state.user.type == 'pro'
state.authenticated = true

localStorage.email = payload.email
localStorage.server = payload.server
localStorage.access_token = data.access_token
localStorage.refresh_token = data.refresh_token
if (process.env.NODE_ENV !== 'production') {
localStorage.master_hash = state.master_hash
localStorage.transmission_key = state.transmission_key
}

HTTPClient.setHeader('Authorization', `Bearer ${state.access_token}`)
},

Logout({ state }) {
state.access_token = null
state.refresh_token = null
Logout({ state }, payload) {
const { data } = AuthService.Logout(payload)
state.transmission_key = null
state.master_hash = null
state.user = null
state.authenticated = false
state.pro = false
const lsKeys = Object.keys(localStorage).filter(key => ['email','server'].includes(key) === false)
lsKeys.forEach(key => localStorage.removeItem(key))

},

async Import(_, data) {
Expand Down
13 changes: 4 additions & 9 deletions src/renderer/views/Home/Sidebar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@

{{ $t('GiveFeedback') }}
<div class="icon">
<VIcon name="external-link" size="11px" />
<VIcon name="external-link" size="14px" />
</div>
</button>
</div>
</template>

<script>
import { mapActions, mapGetters, mapState } from 'vuex'
import HTTPClient from '@/api/HTTPClient'
import { mapGetters, mapState } from 'vuex'
import Axios from 'axios'
import MenuItem from './MenuItem'
import electron from 'electron'
Expand Down Expand Up @@ -136,12 +136,7 @@ export default {
async checkUpdate() {
const { version } = require('../../../../../package.json')
try {
const { data } = await HTTPClient.get(
'https://api.github.com/repos/passwall/passwall-desktop/releases/latest',
{},
{ Authorization: null }
)
const { data } = await Axios.get('https://api.github.com/repos/passwall/passwall-desktop/releases/latest',{})
this.hasUpdate = data.tag_name != version
this.updateLink = data.html_url
} catch (err) {
Expand Down
Loading

0 comments on commit 4bbf276

Please sign in to comment.