mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-13 13:37:31 -07:00
ログアウトの処理と外部サービス連携Viewがセッションクッキーを作らないように (#4856)
This commit is contained in:
parent
212dfe0a0c
commit
094023ddee
2 changed files with 6 additions and 2 deletions
|
@ -54,7 +54,11 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
document.cookie = `i=${this.$store.state.i.token}`;
|
if (!document.cookie.match(/i=(\w+)/)) {
|
||||||
|
document.cookie = `i=${this.$store.state.i.token}; path=/;` +
|
||||||
|
` domain=${document.location.hostname}; max-age=31536000;` +
|
||||||
|
(document.location.protocol.startsWith('https') ? ' secure' : '');
|
||||||
|
}
|
||||||
this.$watch('$store.state.i', () => {
|
this.$watch('$store.state.i', () => {
|
||||||
if (this.$store.state.i.twitter) {
|
if (this.$store.state.i.twitter) {
|
||||||
if (this.twitterForm) this.twitterForm.close();
|
if (this.twitterForm) this.twitterForm.close();
|
||||||
|
|
|
@ -126,7 +126,7 @@ export default (os: MiOS) => new Vuex.Store({
|
||||||
|
|
||||||
logout(ctx) {
|
logout(ctx) {
|
||||||
ctx.commit('updateI', null);
|
ctx.commit('updateI', null);
|
||||||
document.cookie = 'i=;';
|
document.cookie = `i=; max-age=0; domain=${document.location.hostname}`;
|
||||||
localStorage.removeItem('i');
|
localStorage.removeItem('i');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue