import 'package:{{ name }}/services/AuthProvider.dart';
import 'package:dio/dio.dart';
import 'package:meta/meta.dart';

import 'package:{{ name }}/models/User.dart';
import 'package:{{ name }}/models/Auth/JwtToken.dart';

class AuthenticationRepository{
  RestClient api = RestClient(Dio());

  Future<JwtToken> login({
    @required String email,
    @required String password,
    @required bool rememberMe,
  }){
    return api.login(email, password, rememberMe);
  }

  Future<String> logout(){
    return api.logout();
  }

  Future<JwtToken> refresh(){
    return api.refresh();
  }

  Future<String> reset({@required String email}){
    return api.reset(email);
  }

  Future<String> register(String name, String email, String password){
    return api.register(name, email, password);
  }

  Future<User> getUser(){
    return api.getUser();
  }

  Future<String> socialLogin(String provider){
    return api.socialLogin(provider);
  }
}