コード例 #1
0
ファイル: controller.py プロジェクト: BraveNewbies/notes
    def GET(self):
        from brave.notes.core.session import session
        session.kill()
        
        try:
            private = SigningKey.from_string(unhexlify(settings['api']['private']), curve=NIST256p, hashfunc=sha256)
            public = VerifyingKey.from_string(unhexlify(settings['api']['public']), curve=NIST256p, hashfunc=sha256)
        except:
            return "Invalid keys"
        # Perform the initial API call and direct the user.
        api = API(settings['api']['endpoint'], settings['api']['identity'], private, public)

        success = str(settings['domain'] + settings['path'] + '/account/authorized')
        failure = str(settings['domain'] + settings['path'] + '/account/nolove')

        result = api.core.authorize(success=success, failure=failure)

        raise web.seeother(result.location, absolute=True)
コード例 #2
0
ファイル: controller.py プロジェクト: BraveNewbies/notes
 def GET(self):
     from brave.notes.core.session import session
     session.kill()
     raise web.seeother(settings['path'] + '/', absolute=True)