예제 #1
0
def check_authorization(authorization):
    if authorization is not None:
        try:
            prefix, access_key = authorization.split(' ')
        except ValueError:
            return False

        if prefix != '<DEFINE_PREFIX_HERE>':
            return False

        try:
            g.user = User.get_by_access_token(access_key)
        except User.DoesNotExist:
            return False

        return True
def check_authorization(authorization):
    if authorization is not None:
        try:
            ffinder, access_key = authorization.split(' ')
        except ValueError:
            return False

        if ffinder != 'FFINDER':
            return False

        try:
            g.user = User.get_by_access_token(access_key)
        except User.DoesNotExist:
            return False

        return True