### ----------------------------------------------------
### -- Cro::HTTP
### -- Licenses: Artistic-2.0
### -- Authors: Jonathan Worthington <jnthn@jnthn.net>
### -- File: lib/Cro/HTTP/Auth/WebToken/Bearer.rakumod
### ----------------------------------------------------
use Cro::HTTP::Auth::WebToken;

role Cro::HTTP::Auth::WebToken::Bearer does Cro::HTTP::Auth::WebToken {
    method get-token($request) {
        try {
            return $request.header('Authorization').split(' ')[1];
        }
        CATCH {
            default {
                .note;
                return Nil;
            }
        }
    }
}


