summaryrefslogtreecommitdiff
path: root/src/web/app/auth
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2018-04-11 20:27:09 +0900
committerGitHub <noreply@github.com>2018-04-11 20:27:09 +0900
commitd43fe853c3605696e2e57e240845d0fc9c284f61 (patch)
tree838914e262c0fca5737588a7bba64e2b9f3d8e5f /src/web/app/auth
parentUpdate README.md (diff)
parentwip #1443 (diff)
downloadmisskey-d43fe853c3605696e2e57e240845d0fc9c284f61.tar.gz
misskey-d43fe853c3605696e2e57e240845d0fc9c284f61.tar.bz2
misskey-d43fe853c3605696e2e57e240845d0fc9c284f61.zip
Merge pull request #1 from syuilo/master
追従
Diffstat (limited to 'src/web/app/auth')
-rw-r--r--src/web/app/auth/assets/logo.svg7
-rw-r--r--src/web/app/auth/script.ts23
-rw-r--r--src/web/app/auth/style.styl15
-rw-r--r--src/web/app/auth/tags/form.tag130
-rw-r--r--src/web/app/auth/tags/index.tag143
-rw-r--r--src/web/app/auth/tags/index.ts2
6 files changed, 0 insertions, 320 deletions
diff --git a/src/web/app/auth/assets/logo.svg b/src/web/app/auth/assets/logo.svg
deleted file mode 100644
index 19b8a2737e..0000000000
--- a/src/web/app/auth/assets/logo.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
- y="0px" width="1024px" height="512px" viewBox="0 256 1024 512" enable-background="new 0 256 1024 512" xml:space="preserve">
-<polyline opacity="0.5" fill="none" stroke="#000000" stroke-width="34" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="
- 896.5,608.5 800.5,416.5 704.5,608.5 608.5,416.5 512.5,608.5 416.5,416.5 320.5,608.5 224.5,416.5 128.5,608.5 "/>
-</svg>
diff --git a/src/web/app/auth/script.ts b/src/web/app/auth/script.ts
deleted file mode 100644
index dd598d1ed6..0000000000
--- a/src/web/app/auth/script.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Authorize Form
- */
-
-// Style
-import './style.styl';
-
-import * as riot from 'riot';
-require('./tags');
-import init from '../init';
-
-document.title = 'Misskey | アプリの連携';
-
-/**
- * init
- */
-init(() => {
- mount(document.createElement('mk-index'));
-});
-
-function mount(content) {
- riot.mount(document.getElementById('app').appendChild(content));
-}
diff --git a/src/web/app/auth/style.styl b/src/web/app/auth/style.styl
deleted file mode 100644
index bd25e1b572..0000000000
--- a/src/web/app/auth/style.styl
+++ /dev/null
@@ -1,15 +0,0 @@
-@import "../app"
-@import "../reset"
-
-html
- background #eee
-
- @media (max-width 600px)
- background #fff
-
-body
- margin 0
- padding 32px 0
-
- @media (max-width 600px)
- padding 0
diff --git a/src/web/app/auth/tags/form.tag b/src/web/app/auth/tags/form.tag
deleted file mode 100644
index 4a236f7594..0000000000
--- a/src/web/app/auth/tags/form.tag
+++ /dev/null
@@ -1,130 +0,0 @@
-<mk-form>
- <header>
- <h1><i>{ app.name }</i>があなたの<b>アカウント</b>に<b>アクセス</b>することを<b>許可</b>しますか?</h1><img src={ app.icon_url + '?thumbnail&size=64' }/>
- </header>
- <div class="app">
- <section>
- <h2>{ app.name }</h2>
- <p class="nid">{ app.name_id }</p>
- <p class="description">{ app.description }</p>
- </section>
- <section>
- <h2>このアプリは次の権限を要求しています:</h2>
- <ul>
- <virtual each={ p in app.permission }>
- <li if={ p == 'account-read' }>アカウントの情報を見る。</li>
- <li if={ p == 'account-write' }>アカウントの情報を操作する。</li>
- <li if={ p == 'post-write' }>投稿する。</li>
- <li if={ p == 'like-write' }>いいねしたりいいね解除する。</li>
- <li if={ p == 'following-write' }>フォローしたりフォロー解除する。</li>
- <li if={ p == 'drive-read' }>ドライブを見る。</li>
- <li if={ p == 'drive-write' }>ドライブを操作する。</li>
- <li if={ p == 'notification-read' }>通知を見る。</li>
- <li if={ p == 'notification-write' }>通知を操作する。</li>
- </virtual>
- </ul>
- </section>
- </div>
- <div class="action">
- <button onclick={ cancel }>キャンセル</button>
- <button onclick={ accept }>アクセスを許可</button>
- </div>
- <style>
- :scope
- display block
-
- > header
- > h1
- margin 0
- padding 32px 32px 20px 32px
- font-size 24px
- font-weight normal
- color #777
-
- i
- color #77aeca
-
- &:before
- content '「'
-
- &:after
- content '」'
-
- b
- color #666
-
- > img
- display block
- z-index 1
- width 84px
- height 84px
- margin 0 auto -38px auto
- border solid 5px #fff
- border-radius 100%
- box-shadow 0 2px 2px rgba(0, 0, 0, 0.1)
-
- > .app
- padding 44px 16px 0 16px
- color #555
- background #eee
- box-shadow 0 2px 2px rgba(0, 0, 0, 0.1) inset
-
- &:after
- content ''
- display block
- clear both
-
- > section
- float left
- width 50%
- padding 8px
- text-align left
-
- > h2
- margin 0
- font-size 16px
- color #777
-
- > .action
- padding 16px
-
- > button
- margin 0 8px
-
- @media (max-width 600px)
- > header
- > img
- box-shadow none
-
- > .app
- box-shadow none
-
- @media (max-width 500px)
- > header
- > h1
- font-size 16px
-
- </style>
- <script>
- this.mixin('api');
-
- this.session = this.opts.session;
- this.app = this.session.app;
-
- this.cancel = () => {
- this.api('auth/deny', {
- token: this.session.token
- }).then(() => {
- this.trigger('denied');
- });
- };
-
- this.accept = () => {
- this.api('auth/accept', {
- token: this.session.token
- }).then(() => {
- this.trigger('accepted');
- });
- };
- </script>
-</mk-form>
diff --git a/src/web/app/auth/tags/index.tag b/src/web/app/auth/tags/index.tag
deleted file mode 100644
index e71214f4a3..0000000000
--- a/src/web/app/auth/tags/index.tag
+++ /dev/null
@@ -1,143 +0,0 @@
-<mk-index>
- <main if={ SIGNIN }>
- <p class="fetching" if={ fetching }>読み込み中<mk-ellipsis/></p>
- <mk-form ref="form" if={ state == 'waiting' } session={ session }/>
- <div class="denied" if={ state == 'denied' }>
- <h1>アプリケーションの連携をキャンセルしました。</h1>
- <p>このアプリがあなたのアカウントにアクセスすることはありません。</p>
- </div>
- <div class="accepted" if={ state == 'accepted' }>
- <h1>{ session.app.is_authorized ? 'このアプリは既に連携済みです' : 'アプリケーションの連携を許可しました'}</h1>
- <p if={ session.app.callback_url }>アプリケーションに戻っています<mk-ellipsis/></p>
- <p if={ !session.app.callback_url }>アプリケーションに戻って、やっていってください。</p>
- </div>
- <div class="error" if={ state == 'fetch-session-error' }>
- <p>セッションが存在しません。</p>
- </div>
- </main>
- <main class="signin" if={ !SIGNIN }>
- <h1>サインインしてください</h1>
- <mk-signin/>
- </main>
- <footer><img src="/assets/auth/logo.svg" alt="Misskey"/></footer>
- <style>
- :scope
- display block
-
- > main
- width 100%
- max-width 500px
- margin 0 auto
- text-align center
- background #fff
- box-shadow 0px 4px 16px rgba(0, 0, 0, 0.2)
-
- > .fetching
- margin 0
- padding 32px
- color #555
-
- > div
- padding 64px
-
- > h1
- margin 0 0 8px 0
- padding 0
- font-size 20px
- font-weight normal
-
- > p
- margin 0
- color #555
-
- &.denied > h1
- color #e65050
-
- &.accepted > h1
- color #54af7c
-
- &.signin
- padding 32px 32px 16px 32px
-
- > h1
- margin 0 0 22px 0
- padding 0
- font-size 20px
- font-weight normal
- color #555
-
- @media (max-width 600px)
- max-width none
- box-shadow none
-
- @media (max-width 500px)
- > div
- > h1
- font-size 16px
-
- > footer
- > img
- display block
- width 64px
- height 64px
- margin 0 auto
-
- </style>
- <script>
- this.mixin('i');
- this.mixin('api');
-
- this.state = null;
- this.fetching = true;
-
- this.token = window.location.href.split('/').pop();
-
- this.on('mount', () => {
- if (!this.SIGNIN) return;
-
- // Fetch session
- this.api('auth/session/show', {
- token: this.token
- }).then(session => {
- this.session = session;
- this.fetching = false;
-
- // 既に連携していた場合
- if (this.session.app.is_authorized) {
- this.api('auth/accept', {
- token: this.session.token
- }).then(() => {
- this.accepted();
- });
- } else {
- this.update({
- state: 'waiting'
- });
-
- this.refs.form.on('denied', () => {
- this.update({
- state: 'denied'
- });
- });
-
- this.refs.form.on('accepted', this.accepted);
- }
- }).catch(error => {
- this.update({
- fetching: false,
- state: 'fetch-session-error'
- });
- });
- });
-
- this.accepted = () => {
- this.update({
- state: 'accepted'
- });
-
- if (this.session.app.callback_url) {
- location.href = this.session.app.callback_url + '?token=' + this.session.token;
- }
- };
- </script>
-</mk-index>
diff --git a/src/web/app/auth/tags/index.ts b/src/web/app/auth/tags/index.ts
deleted file mode 100644
index 42dffe67d9..0000000000
--- a/src/web/app/auth/tags/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-require('./index.tag');
-require('./form.tag');