Questions tagged [guard]

Guard is a command line tool to easily handle events on file system modifications.

Guard is a command line tool to easily handle events on file system modifications (FSEvent / Inotify / Polling support).

884 questions
-1
votes
2 answers

canLoad guard doesn't get the updated value

UPD. Solved. I was using 2 instanses of a service and it caused problems I'm stuck with canLoad guard. When i push a button in component I want to change the false value in service and let my Guard to load a module. But guard only receives a false…
Max M
  • 1
  • 3
-1
votes
1 answer

web guard allows login but admin guard does not allow login

I define a new guard "Admin" to have a multi Auth System User and admin in my project . web guard allows login.But admin guard does not allow login when I try to login into Admin ,it gives SQLSTATE[42S22]: Column not found: 1054 Unknown column…
-1
votes
2 answers

guard let found nil

I am new to guard let patterns. How come my app crashes when selectedRooms.text is nil instead of doing the return part? And why is rooms of optional type when I know that numberOfRooms is not nil? guard let numberOfRooms = selectedRooms.text else…
-1
votes
1 answer

How to chose guard for session driver

I'm trying to create a login page with laravel web route. When user login, a session record will be saved to database. But in session table, user_id always get null value. I've found that in Illuminate\Session\DatabaseSessionHandler, function…
simpsons3
  • 880
  • 1
  • 11
  • 29
-1
votes
2 answers

Angular Routing always show url before component

I don't know what happen, but in my Angular 7 apps when i input some url via browser it's always following url that i'm typing. Example : typing => http://localhost:4200/xxx result => http://localhost:4200/xxx/dashboard typing =>…
lucky.omen
  • 15
  • 4
-1
votes
1 answer

check validation guard inside function

How to validate the guard inside var declaration var completionTime: DateComponents{ let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MM/dd/yyyy HH:mm" let selectedDateTime = mergeDateTime() guard…
KkMIW
  • 1,092
  • 1
  • 17
  • 27
-1
votes
1 answer

Role guard sometimes allows entry into secured components on localhost

My RoleGuard looks like this: import { CanLoad, Route } from "@angular/router"; import { AuthenticationService } from "../_services"; import { Injectable } from "@angular/core"; @Injectable({ providedIn: 'root' }) export class RoleGuard implements…
-1
votes
1 answer

what is the best way to add age restrictions to your app using xcode and swift

I need to put an age requirement on the app i am currently building and im looking for opinions on what you guys think would be the most efficient way to add this into the code. Should i use a guard let on the sign up screen or protocol?
jdoubleu
  • 1
  • 1
-1
votes
2 answers

Exit early using `guard` without typing `return` - only possible using `Never`?

Swift's guard statement is awesome for early exits. In some scenarios, we might want to perform one call besides exiting using return. final class AppCoordinator { func showApplePaySplash() -> Void { /* some presentation logic */ } } final…
Sajjon
  • 8,938
  • 5
  • 60
  • 94
-1
votes
1 answer

How to check which guard we are currently within in laravel

I have here a portion of my header.blade.php file of a project. @guest @else
-1
votes
9 answers

how can i prevent users to share their login details for my web app

what i have until now: session on server side unique id (md5) of computer created by Request.ServerVariables("HTTP_USER_AGENT") & REMOTE_HOST and saved on the database but what else can i do in this case? users continue to share their login…
Sasha
  • 20,424
  • 9
  • 40
  • 57
-1
votes
1 answer

Guard does not exit function

This might be a very stupid question but bear with me: To my understanding and after reading the documentation and various examples on other websites, a guard statement checks a bool. If it's true, the current scope continued in execution. If not,…
Marmelador
  • 947
  • 7
  • 27
-1
votes
2 answers

How to properly set up a For- In Loop within a Guard statement?

I'm trying to set up a loop to retrieve info from inside a json dictionary but the dictionary is in a guard statement: guard let resultsDictionary = jsonDictionary["result"] as? [[String : Any]]?, let costDictionary = resultsDictionary?[0], …
SwiftyJD
  • 5,257
  • 7
  • 41
  • 92
-1
votes
1 answer

Guard vs if-let

let task = urlSession.dataTaskWithRequest(urlRequest) { (data, response, error) -> Void in guard error == nil else { print("Error while fetching remote rooms: \(error)") return } Is the below block can be alternative of the…
user804417
  • 155
  • 2
  • 13
-1
votes
1 answer

Error handling on native methods swift

new to swift i do not understand how to handle error. I have understood, using guard, throw, do and try for my own methods. But how can i handle errors from apple native methods like : self.displayContent?.addAttribute(NSFontAttributeName, value:…
user2206906
  • 1,310
  • 2
  • 13
  • 18
1 2 3
58
59