forked from eatvio/eatvio_app
feat(auth): Issue-691
This commit is contained in:
@@ -391,10 +391,14 @@ class _SocialButton extends StatelessWidget {
|
||||
|
||||
void _onVkPressed() async {
|
||||
try {
|
||||
final accessToken = await SocialAuthFacade.signInWithVk();
|
||||
if (accessToken == null) {
|
||||
final context = AppRouter.navigatorKey.currentContext;
|
||||
if (context == null) return;
|
||||
|
||||
final authResult = await SocialAuthFacade.signInWithVkAndFetchProfile(context: context);
|
||||
if (authResult == null) {
|
||||
return;
|
||||
}
|
||||
AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'vk');
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
@@ -402,10 +406,14 @@ void _onVkPressed() async {
|
||||
|
||||
void _onOkPressed() async {
|
||||
try {
|
||||
final accessToken = await SocialAuthFacade.signInWithOk();
|
||||
if (accessToken == null) {
|
||||
final context = AppRouter.navigatorKey.currentContext;
|
||||
if (context == null) return;
|
||||
|
||||
final authResult = await SocialAuthFacade.signInWithOkAndFetchProfile();
|
||||
if (authResult == null) {
|
||||
return;
|
||||
}
|
||||
AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'ok');
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
@@ -413,18 +421,27 @@ void _onOkPressed() async {
|
||||
|
||||
void _onMailRuPressed() async {
|
||||
try {
|
||||
final accessToken = await SocialAuthFacade.signInWithMailRu();
|
||||
if (accessToken == null) {
|
||||
final context = AppRouter.navigatorKey.currentContext;
|
||||
if (context == null) return;
|
||||
|
||||
final authResult = await SocialAuthFacade.signInWithMailRuAndFetchProfile();
|
||||
if (authResult == null) {
|
||||
return;
|
||||
}
|
||||
AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'mailru');
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
void _onYandexPressed() async {
|
||||
final accessToken = await SocialAuthFacade.signInWithYandex();
|
||||
if (accessToken == null) return;
|
||||
try {
|
||||
final authResult = await SocialAuthFacade.signInWithYandex();
|
||||
if (authResult == null) return;
|
||||
AppRouter.navigateToRegisterViaSocial(authResult: authResult, provider: 'yandex');
|
||||
} catch (e) {
|
||||
log(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _reconnectAfterAuth() async {
|
||||
|
||||
Reference in New Issue
Block a user